Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/architecture/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ neodos/
├── libnet/ # User-mode networking library
├── userbin/ # 52 user binaries (PID 1, shell, utilities)
├── drivers/ # 10 standalone NEM drivers
├── tools/ # 4 Rust host tools + 1 Python script
├── tools/ # 5 Rust host tools + 1 Python script
│ ├── crashdump/ # Crash dump decoder
│ ├── gen-hiv/ # Registry hive generator
│ ├── kbdcompile/ # Keyboard layout compiler
│ ├── kbdcompile/ # Keyboard layout compiler (.klc → .kbd)
│ ├── xkbcompile/ # Keyboard layout compiler (XKB → .kbd)
│ └── nltc/ # NLT compiler
├── scripts/ # bash utilities (MCP server migrated → neodos-dev-server)
├── data/ # Locale TOML (141 files) + keyboard layouts
Expand Down Expand Up @@ -109,7 +110,8 @@ kbdcompile (host) ───→ data/keyboard (layout sources)
| `nxdump` | Host tool, reads ELF/NXE/NEM files. |
| `nxeinfo` | Host tool, reads NXE headers. |
| `nxpkg` | Host tool, creates/extracts NXP packages. |
| `kbdcompile` | Host tool, compiles keyboard layouts. |
| `kbdcompile` | Host tool, compiles keyboard layouts (`.klc` → `.kbd`). |
| `xkbcompile` | Host tool, converts XKB layouts → `.kbd`. |
| `scripts/mcp_server` | Python, completely independent. |
| `scripts/check_deps.py` | Python, standalone validation. |
| `scripts/gen_*` | Python, host-side data generation. |
Expand Down Expand Up @@ -142,7 +144,7 @@ kbdcompile (host) ───→ data/keyboard (layout sources)
|-----------|-----------|-----------|
| `neodev` | `NeoDev` | Fully standalone host tool. Standard Rust deps (clap, anyhow, serde). Changes at own pace. Can version independently. Build/test/image creation for any repo. |
| `neodos-lsp` + `scripts/mcp_server` | `NeoDOS Dev Server` (merged) | **Migrated.** LSP + MCP merged into single Rust workspace at [neodos-dev-server](https://github.com/NeoDOS-Project/neodos-dev-server). Shared toolkit (neodos-toolkit) + LSP binary + MCP binary. |
| `nltc, kbdcompile` | `NeoToolchain` or separate | Both are host-side compilers for OS data formats. Can evolve independently of kernel version. |
| `nltc, kbdcompile, xkbcompile` | `NeoToolchain` or separate | Host-side compilers for OS data formats. Can evolve independently of kernel version. |
| `nxdump, nxeinfo, nxpkg` | `NeoTools` | UX-focused analysis tools. Independent release cycle. Useful for OS analysis even without building kernel. |
| `scripts/mcp_server` | `NeoMCP` | Python MCP server for AI-assisted development. Completely independent of kernel. |
| `data/locale/*` | `NeoTranslations` | Translation data. Community contributions don't need kernel access. Can be translated entirely by non-developers. |
Expand Down
12 changes: 11 additions & 1 deletion docs/design/neokbd-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,17 @@ Los layouts se generan desde los mismos archivos `.klc` existentes, pero convert
| `US.kbd` | US | en-US | 256 | 0 |
| `Spanish.kbd` | Spanish | es-ES | 256 | 54 |

La herramienta `kbdcompile` toma un `.klc` y produce un `.kbd` binario. Se invoca en el build de la imagen, no en runtime.
La herramienta `kbdcompile` toma un `.klc` y produce un `.kbd` binario.

Alternativa abierta y offline: `tools/xkbcompile` convierte un layout XKB
(`/usr/share/X11/xkb/symbols/*`) a `.kbd` directamente, sin pasar por `.klc`:

```text
xkbcompile es basic --name es-ES --lang es-ES --out data/keyboard/es-ES.kbd
```

XKB cubre muchos idiomas con licencia abierta; sus límites (un solo grupo,
niveles 1-3, keysyms exóticos) están en `tools/xkbcompile/README.md`.

---

Expand Down
7 changes: 7 additions & 0 deletions tools/xkbcompile/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions tools/xkbcompile/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "xkbcompile"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "xkbcompile"
path = "src/main.rs"

[dependencies]
46 changes: 46 additions & 0 deletions tools/xkbcompile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# xkbcompile

Host tool: convert a **Linux XKB** layout (`/usr/share/X11/xkb/symbols/*`) into
the NeoDOS `.kbd` keyboard format. Complements `kbdcompile` (which reads the
Microsoft `.klc` format); XKB is offline and openly licensed, so it is the
preferred source for shipping many languages.

```bash
cargo build
./target/debug/xkbcompile <layout> [variant] \
[--name TAG] [--lang TAG] [--out FILE] \
[--symbols-dir DIR] [--keycodes FILE] [--compose FILE]

# Spanish (es) base variant -> data/keyboard/es-ES.kbd
./target/debug/xkbcompile es basic --name es-ES --lang es-ES \
--out ../../data/keyboard/es-ES.kbd
```

Defaults: `--symbols-dir /usr/share/X11/xkb/symbols`,
`--keycodes /usr/share/X11/xkb/keycodes/evdev`,
`--compose /usr/share/X11/locale/en_US.UTF-8/Compose`, `--out
data/keyboard/<name>.kbd`.

## What it does

- Resolves `include "file(section)"` chains (e.g. `es(basic)` →
`latin(type4)` → `latin(basic)`), later `key` definitions overriding earlier.
- Maps EVDEV keycodes to PC set-1 scancodes (`set1 = evdev - 8`).
- Maps levels 1-3 to the kernel's `normal`/`shift`/`altgr` columns.
- Translates keysyms: Latin-1 names, `U<hex>` Unicode keysyms and the common
punctuation/accent names.
- Marks `dead_*` keysyms (per level) and builds the compose table from the
X11 `Compose` file for the dead keys used.

## Limits

- Only the first keyboard group; levels 4+ (Shift+AltGr) are dropped (the
kernel format has no such column).
- Exotic keysyms (Greek, Cyrillic, ligatures, `Greek_*`, `XF86*`) are not
translated and leave the key unmapped.
- The `Ctrl` column is left unset (XKB does not define ctrl levels); the kernel
falls back to the normal/shift value.

Adding a layout to the OS also needs wiring it into `neodev/src/image.rs`
(`kbd_layouts`) and the kernel load list (`load_layouts()`), until dynamic
`.kbd` discovery lands (#390).
Loading
Loading