Sort all non-derive outer attributes alphabetically by name,
place `#[derive(...)]` last (before any derive helper attributes
like `#[serde(...)]` and `#[clap(...)]`), and sort traits inside
`#[derive(...)]` alphabetically. This covers 329 files with 704
line changes (all pure reordering, no semantic changes).
Key patterns normalized:
- `#[cfg(...)]` comes first (c), then other attrs alphabetically
- `#[repr(...)]` stays before `#[derive(...)]` (derive is always last)
- `#[padding_struct]` and `#[pod_union]` precede `#[derive(...)]`
- Derive helper attrs like `#[serde(...)]` remain after `#[derive(...)]`
- Derive traits like `Debug, Clone, Copy` become `Clone, Copy, Debug`
- The common set `{Debug, Clone, Copy, Pod, Default}` (59 uses,
12 prior orderings) is now uniformly `Clone, Copy, Debug, Default, Pod`
Add support for virtual console TTY mode management ioctls required by
Xorg and other display servers. The implementation includes:
- KDGETMODE: Query the current virtual console mode
- KDSETMODE: Switch between text and graphics modes
Virtual consoles utilize the framebuffer with two distinct modes:
- Text mode (default): Kernel renders text characters to framebuffer
- Graphics mode: User space applications gain full framebuffer control
Xorg requires KDSETMODE during initialization to switch to graphics
mode, preventing conflicts where both the kernel and Xorg would
simultaneously attempt to write to the framebuffer. This ensures
proper display handling and eliminates rendering artifacts.
Co-authored-by: Ruihan Li <lrh2000@pku.edu.cn>