|
@@ -138,10 +138,10 @@ make clean
|
|
|
compat ladder without a display; `--keys 'clo{down}{enter}'` types into
|
|
compat ladder without a display; `--keys 'clo{down}{enter}'` types into
|
|
|
the headless window (100 ms per key from 300 ms after the first frame;
|
|
the headless window (100 ms per key from 300 ms after the first frame;
|
|
|
`{enter} {esc} {tab} {bs} {del} {up} {down} {left} {right} {ctrl-l}
|
|
`{enter} {esc} {tab} {bs} {del} {up} {down} {left} {right} {ctrl-l}
|
|
|
- {wait}`). It needs the multilib `lib32-sdl3`,
|
|
|
|
|
|
|
+ {wait}`, and `{click:X,Y}` for a left click at canvas coordinates). It needs the multilib `lib32-sdl3`,
|
|
|
`lib32-wayland` and `lib32-libxkbcommon`; host sockets replace the NebOS TCP
|
|
`lib32-wayland` and `lib32-libxkbcommon`; host sockets replace the NebOS TCP
|
|
|
stack and the kernel/WM paths are not exercised.
|
|
stack and the kernel/WM paths are not exercised.
|
|
|
-- QEMU guests default to 512 MB (`QEMU_MEM`, e.g. `make run QEMU_MEM=1G`),
|
|
|
|
|
|
|
+- QEMU guests default to 1 GB (`QEMU_MEM`, e.g. `make run QEMU_MEM=512M`),
|
|
|
matching `MM_MAX_PHYS` in `phys.h`; all run and UEFI targets pass `-m`.
|
|
matching `MM_MAX_PHYS` in `phys.h`; all run and UEFI targets pass `-m`.
|
|
|
- The command pack is the system rootfs: `cmds.pack` (NBPAK1), gzip-compressed
|
|
- The command pack is the system rootfs: `cmds.pack` (NBPAK1), gzip-compressed
|
|
|
to `cmds_pack_gz.bin`, wrapped by `mkrootfs` with a one-sector `NBROOT1`
|
|
to `cmds_pack_gz.bin`, wrapped by `mkrootfs` with a one-sector `NBROOT1`
|
|
@@ -251,7 +251,7 @@ and `make net-dev`/`kernel-net-dev` reload over the network. `bootlog save
|
|
|
5. **UEFI (`boot/efi/`)** — an x86-64 PE32+ `BOOTX64.EFI` loads from the ESP. It
|
|
5. **UEFI (`boot/efi/`)** — an x86-64 PE32+ `BOOTX64.EFI` loads from the ESP. It
|
|
|
picks a GOP mode, converts `GetMemoryMap` into the E820 map at `0x1000`,
|
|
picks a GOP mode, converts `GetMemoryMap` into the E820 map at `0x1000`,
|
|
|
stages `kernel.bin` below 4 GB, allocates a loader-data buffer below the
|
|
stages `kernel.bin` below 4 GB, allocates a loader-data buffer below the
|
|
|
- 512 MB identity window (above the low 1 MB) for the embedded gz rootfs
|
|
|
|
|
|
|
+ 1 GB identity window (above the low 1 MB) for the embedded gz rootfs
|
|
|
and copies it there, fills
|
|
and copies it there, fills
|
|
|
`0x500` (boot info) and `0x600` (framebuffer), calls `ExitBootServices`,
|
|
`0x500` (boot info) and `0x600` (framebuffer), calls `ExitBootServices`,
|
|
|
copies a 192-byte trampoline to `0x800`,
|
|
copies a 192-byte trampoline to `0x800`,
|
|
@@ -285,7 +285,7 @@ a Pentium 1 (and a Pentium II board without ACPI) on the UP path.
|
|
|
| `0x60000` | No longer a rootfs staging area: the legacy stage copies each 16 KB chunk straight to `0x900000`. The kernel BSS/boot stack may use this range |
|
|
| `0x60000` | No longer a rootfs staging area: the legacy stage copies each 16 KB chunk straight to `0x900000`. The kernel BSS/boot stack may use this range |
|
|
|
| `_end` | Kernel end (linker symbol; `kernel.ld` keeps `_end <= 0x90000` so the top of the low-memory gap and the EBDA stay untouched). BSS and the boot stack may extend past `0x60000` |
|
|
| `_end` | Kernel end (linker symbol; `kernel.ld` keeps `_end <= 0x90000` so the top of the low-memory gap and the EBDA stay untouched). BSS and the boot stack may extend past `0x60000` |
|
|
|
| (in-image) | Bootstrap/protected-mode stack: 8 KB `.stack` NOLOAD section, `__boot_stack_top`/`__boot_stack_bottom` (travels with the kernel) |
|
|
| (in-image) | Bootstrap/protected-mode stack: 8 KB `.stack` NOLOAD section, `__boot_stack_top`/`__boot_stack_bottom` (travels with the kernel) |
|
|
|
-| `0x900000`| Legacy boot-time rootfs pack written directly by `vesa_stage.S` (reserved by `mm_init` until `ramfs_init` takes its copy, then freed; process stacks and kexec staging also start here) |
|
|
|
|
|
|
|
+| `0x900000`| Legacy boot-time rootfs pack written directly by `vesa_stage.S` (reserved by `mm_init` until `ramfs_init` takes its copy, then freed); `mm_init` places the frame bitmap in the first RAM after it (`0xAF3000` with today's pack); process stacks and kexec staging also start here |
|
|
|
| `0x100000`| VGA shadow buffer (`VGA_SHADOW_BASE`, `vga.h`) |
|
|
| `0x100000`| VGA shadow buffer (`VGA_SHADOW_BASE`, `vga.h`) |
|
|
|
|
|
|
|
|
The legacy stage uses `0x3000..0x6FFF` as a 16 KB-chunk rootfs staging
|
|
The legacy stage uses `0x3000..0x6FFF` as a 16 KB-chunk rootfs staging
|
|
@@ -295,7 +295,7 @@ later.
|
|
|
|
|
|
|
|
The boot-time rootfs pack placement depends on the boot path: the legacy
|
|
The boot-time rootfs pack placement depends on the boot path: the legacy
|
|
|
stage copies it directly to `0x900000`, the UEFI loader puts it at the top of
|
|
stage copies it directly to `0x900000`, the UEFI loader puts it at the top of
|
|
|
-RAM below 512 MB, and kexec leaves it in the staging buffer
|
|
|
|
|
|
|
+RAM below 1 GB, and kexec leaves it in the staging buffer
|
|
|
(≥ `0x900000`). `mm_init` reserves `[pack_addr, pack_addr+pack_size)` from
|
|
(≥ `0x900000`). `mm_init` reserves `[pack_addr, pack_addr+pack_size)` from
|
|
|
boot info when it is above the low 1 MB, so the legacy pack is protected
|
|
boot info when it is above the low 1 MB, so the legacy pack is protected
|
|
|
from the frame allocator too. `ramfs_init` copies/inflates it into fresh
|
|
from the frame allocator too. `ramfs_init` copies/inflates it into fresh
|
|
@@ -353,10 +353,20 @@ it to `0x7E00`. The kernel region itself only has one wall (`_end` below
|
|
|
trampoline at `0x6000`), and `spinlock.h` (the IRQ-safe spinlocks).
|
|
trampoline at `0x6000`), and `spinlock.h` (the IRQ-safe spinlocks).
|
|
|
`cpu_enable_sse()` runs on every AP: an AP starts with firmware CR4, and the
|
|
`cpu_enable_sse()` runs on every AP: an AP starts with firmware CR4, and the
|
|
|
SSE2 drawing fast paths #UD until OSFXSR/OSXMMEXCPT are set.
|
|
SSE2 drawing fast paths #UD until OSFXSR/OSXMMEXCPT are set.
|
|
|
-- **Memory**: `phys.h` — the shared 512 MB physical ceiling (`MM_MAX_PHYS`),
|
|
|
|
|
- also used by the UEFI loader. `mm.c/h` — INT 15h E820 detection (real-mode in
|
|
|
|
|
|
|
+- **Memory**: `phys.h` — the shared 1 GB physical ceiling (`MM_MAX_PHYS`),
|
|
|
|
|
+ also used by the UEFI loader; it ends where ring-3 space starts
|
|
|
|
|
+ (`USER_BASE` = `0x40000000`), and `paging.c` statically asserts that the
|
|
|
|
|
+ identity map never reaches a user window. RAM above 1 GB is ignored (no
|
|
|
|
|
+ highmem zone or PAE yet). `mm.c/h` — INT 15h E820 detection (real-mode in
|
|
|
`vesa_stage.S`, map at `0x1000`) + a bitmap page-frame allocator (4 KB
|
|
`vesa_stage.S`, map at `0x1000`) + a bitmap page-frame allocator (4 KB
|
|
|
- pages). Reserves low 1 MB and an 8 MB VGA-shadow region. `kmalloc.c/h` — a power-of-two heap
|
|
|
|
|
|
|
+ pages). Reserves low 1 MB and an 8 MB VGA-shadow region. The bitmap is
|
|
|
|
|
+ sized to the highest E820 RAM address (32 KB at 1 GB) and is not in BSS:
|
|
|
|
|
+ `mm_init` places it in the first RAM run at or above `0x900000` that
|
|
|
|
|
+ avoids the boot pack and the LFB and marks its own pages used (a 512-byte
|
|
|
|
|
+ static array covers the 16 MB no-E820 fallback). Allocation is lowest
|
|
|
|
|
+ address first: a `first_free` word hint skips the full low words,
|
|
|
|
|
+ `mm_alloc_page()` finds the bit with `bsf`, and `mm_alloc_pages()` steps
|
|
|
|
|
+ over full and empty words 32 pages at a time. `kmalloc.c/h` — a power-of-two heap
|
|
|
allocator on top of the frame allocator (used for PCBs and command context).
|
|
allocator on top of the frame allocator (used for PCBs and command context).
|
|
|
Process stacks (≥ `0x900000`) come from the frame allocator, with an 8-stack
|
|
Process stacks (≥ `0x900000`) come from the frame allocator, with an 8-stack
|
|
|
fallback pool (a static BSS array; no fixed address).
|
|
fallback pool (a static BSS array; no fixed address).
|
|
@@ -500,8 +510,10 @@ it to `0x7E00`. The kernel region itself only has one wall (`_end` below
|
|
|
window still gets its release after the pointer leaves. The userland
|
|
window still gets its release after the pointer leaves. The userland
|
|
|
`ngui.c/h` immediate-mode toolkit builds on those: clipped RGB565
|
|
`ngui.c/h` immediate-mode toolkit builds on those: clipped RGB565
|
|
|
primitives, buttons, text input, the Adwaita symbolic icons and scrolling panes
|
|
primitives, buttons, text input, the Adwaita symbolic icons and scrolling panes
|
|
|
- (`ngui_scroll`; `hide_bar` keeps wheel/key scrolling without drawing a
|
|
|
|
|
- scrollbar).
|
|
|
|
|
|
|
+ (`ngui_scroll`: an overlay scrollbar that is hidden while the pointer is
|
|
|
|
|
+ outside the pane, slides in on hover over ~100 ms, and reserves no layout
|
|
|
|
|
+ width; presses in its strip start the drag and do not reach the content;
|
|
|
|
|
+ `hide_bar` suppresses it entirely).
|
|
|
`files` (`ucmd_files.c`) is its first user (its toolbar's `Disks`
|
|
`files` (`ucmd_files.c`) is its first user (its toolbar's `Disks`
|
|
|
button opens the storage manager); `gallery` (`gallery.c`) is the
|
|
button opens the storage manager); `gallery` (`gallery.c`) is the
|
|
|
live showcase of every control and primitive the toolkit exports. Buttons
|
|
live showcase of every control and primitive the toolkit exports. Buttons
|
|
@@ -1101,9 +1113,14 @@ it to `0x7E00`. The kernel region itself only has one wall (`_end` below
|
|
|
(decoding RGB565 or BGR from the saved background); a shape change
|
|
(decoding RGB565 or BGR from the saved background); a shape change
|
|
|
presents the union of the old and new rectangles at once. Intel
|
|
presents the union of the old and new rectangles at once. Intel
|
|
|
Ironlake and Radeon copy the image into their 64x64 ARGB planes (Intel's
|
|
Ironlake and Radeon copy the image into their 64x64 ARGB planes (Intel's
|
|
|
- CURPOS takes sign-magnitude negatives; Radeon clamps the position at 0
|
|
|
|
|
- and skips the hidden part with `HORZ_VERT_OFF` and a `CUR_OFFSET` shifted
|
|
|
|
|
- by 256 bytes per row, like Linux's legacy path); Cirrus thresholds alpha
|
|
|
|
|
|
|
+ CURPOS takes sign-magnitude negatives; the Intel cursor gamma enable
|
|
|
|
|
+ follows the matching primary plane's `DSPxCNTR` gamma enable, because the
|
|
|
|
|
+ display palette sits after the plane blender and forcing cursor gamma on
|
|
|
|
|
+ in a VBE mode whose primary bypasses it sends only the cursor through the
|
|
|
|
|
+ palette and gives its antialiased edges a bright halo; Radeon clamps the
|
|
|
|
|
+ position at 0 and skips the hidden part with `HORZ_VERT_OFF` and a
|
|
|
|
|
+ `CUR_OFFSET` shifted by 256 bytes per row, like Linux's legacy path);
|
|
|
|
|
+ Cirrus thresholds alpha
|
|
|
at 50% into its AND/XOR planes (white/black by luminance) and clamps the
|
|
at 50% into its AND/XOR planes (white/black by luminance) and clamps the
|
|
|
position at 0. An image upload never runs from IRQ12, which only moves.
|
|
position at 0. An image upload never runs from IRQ12, which only moves.
|
|
|
Animated shapes advance from `mouse_poll_update()`. Scroll from every backend accumulates in
|
|
Animated shapes advance from `mouse_poll_update()`. Scroll from every backend accumulates in
|
|
@@ -2482,8 +2499,8 @@ and the WM falls back to polling (`io_keyboard_irq_masked()`).
|
|
|
structure whose fields are read before being written must be cleared on
|
|
structure whose fields are read before being written must be cleared on
|
|
|
allocation. `clear_proc()` (`process.c`) exists for exactly this: a stale
|
|
allocation. `clear_proc()` (`process.c`) exists for exactly this: a stale
|
|
|
`procs[i].cr3` made the boot-time MMIO mapping (`paging_map_mmio_cr3`) fault
|
|
`procs[i].cr3` made the boot-time MMIO mapping (`paging_map_mmio_cr3`) fault
|
|
|
- on the board while QEMU was fine. Anything above `MM_MAX_PHYS` (512 MB) is
|
|
|
|
|
- also *unmapped*, so a wild pointer there is an instant #PF.
|
|
|
|
|
|
|
+ on the board while QEMU was fine. Anything between `MM_MAX_PHYS` (1 GB) and
|
|
|
|
|
+ the user windows is *unmapped*, so a wild pointer there is an instant #PF.
|
|
|
- **All drawing goes into the current render target** (the shadow buffer by
|
|
- **All drawing goes into the current render target** (the shadow buffer by
|
|
|
default; `vga_target()`, see the graphics bullet); the main loop flushes the
|
|
default; `vga_target()`, see the graphics bullet); the main loop flushes the
|
|
|
pending damage rects to VRAM on every iteration (byte
|
|
pending damage rects to VRAM on every iteration (byte
|
|
@@ -2521,9 +2538,11 @@ and the WM falls back to polling (`io_keyboard_irq_masked()`).
|
|
|
3. No per-process address spaces or process isolation (paging is identity-mapped).
|
|
3. No per-process address spaces or process isolation (paging is identity-mapped).
|
|
|
4. FAT32: FSInfo free-count not updated, no directory-chain growth.
|
|
4. FAT32: FSInfo free-count not updated, no directory-chain growth.
|
|
|
5. `disk.c` `fdc_reset()` and `fdc_init_once()` overlap/duplicate logic.
|
|
5. `disk.c` `fdc_reset()` and `fdc_init_once()` overlap/duplicate logic.
|
|
|
-6. Killing/reaping a ring-3 process frees its kernel stack and page directory
|
|
|
|
|
- but not the user pages mapped into it (a few pages leak per command run;
|
|
|
|
|
- needs a page-table walk/unmap on reap).
|
|
|
|
|
|
|
+6. Physical RAM above 1 GB is unused: the identity map stops at `USER_BASE`
|
|
|
|
|
+ (`0x40000000`). Using it needs a highmem zone (user-only frames plus a
|
|
|
|
|
+ per-CPU temporary kernel mapping for zeroing/ELF loads) and, for RAM above
|
|
|
|
|
+ 4 GB, PAE. MMIO is still mapped at its physical address, which also
|
|
|
|
|
+ blocks growing ring-3 space above the PCI hole.
|
|
|
7. `display` (needs a GPU snapshot) and `lsusb` (a 45-byte wrapper around
|
|
7. `display` (needs a GPU snapshot) and `lsusb` (a 45-byte wrapper around
|
|
|
the USB tree printer) are the last non-privileged commands still living in
|
|
the USB tree printer) are the last non-privileged commands still living in
|
|
|
the kernel, plus the privileged ones (`peek`, `poke`, `dbg`, `serial`,
|
|
the kernel, plus the privileged ones (`peek`, `poke`, `dbg`, `serial`,
|
|
@@ -2606,15 +2625,17 @@ and the WM falls back to polling (`io_keyboard_irq_masked()`).
|
|
|
`websrv` cannot start while any TCP socket is open. Kill the other
|
|
`websrv` cannot start while any TCP socket is open. Kill the other
|
|
|
command first.
|
|
command first.
|
|
|
20. `/share` is RAM only: a reboot/kexec starts empty, and the 16 MB cap is
|
|
20. `/share` is RAM only: a reboot/kexec starts empty, and the 16 MB cap is
|
|
|
- charged against the 512 MB identity-mapped window.
|
|
|
|
|
|
|
+ charged against the 1 GB identity-mapped window.
|
|
|
|
|
|
|
|
21. The TCP backlog's early-request buffers cost 8 KB of kernel BSS
|
|
21. The TCP backlog's early-request buffers cost 8 KB of kernel BSS
|
|
|
(8 slots x 1 KB), and the FAT listing cache another 5 KB. The command
|
|
(8 slots x 1 KB), and the FAT listing cache another 5 KB. The command
|
|
|
pack is out of the kernel now; after the WiFi/netmenu/install code and the
|
|
pack is out of the kernel now; after the WiFi/netmenu/install code and the
|
|
|
per-connection TCP queues moved to the frame allocator, `_end` is
|
|
per-connection TCP queues moved to the frame allocator, `_end` is
|
|
|
- ~0x8ef20 (with the 6200/6300 DVM layer, the RTL8821AU driver, the
|
|
|
|
|
|
|
+ ~0x8ef20 before (with the 6200/6300 DVM layer, the RTL8821AU driver, the
|
|
|
8×16 boot-console font, the IOAPIC/AMD-thermal additions and the safe
|
|
8×16 boot-console font, the IOAPIC/AMD-thermal additions and the safe
|
|
|
- AMD MTRR path, the 32x32 cursor save buffer and the mount-policy table), ~4 KB below the `0x90000` wall, and the remaining limit
|
|
|
|
|
|
|
+ AMD MTRR path, the 32x32 cursor save buffer and the mount-policy table)
|
|
|
|
|
+ ~0x8bf20 now that the frame bitmap moved out of BSS, ~16 KB below the
|
|
|
|
|
+ `0x90000` wall, and the remaining limit
|
|
|
is kernel code/buffers only.
|
|
is kernel code/buffers only.
|
|
|
|
|
|
|
|
22. Browser limits: JavaScript runs inline and external classic scripts on
|
|
22. Browser limits: JavaScript runs inline and external classic scripts on
|
|
@@ -3023,5 +3044,5 @@ and the WM falls back to polling (`io_keyboard_irq_masked()`).
|
|
|
for every spinner frame; both paths were written from the Linux
|
|
for every spinner frame; both paths were written from the Linux
|
|
|
drivers and only Cirrus and the software cursor are tested in QEMU.
|
|
drivers and only Cirrus and the software cursor are tested in QEMU.
|
|
|
The cursor shape follows the WM poll, so it can lag the pointer by
|
|
The cursor shape follows the WM poll, so it can lag the pointer by
|
|
|
- one WM loop. The 4 KB save buffer and the cursor code (~8 KB in all) leave `_end` at
|
|
|
|
|
- ~0x8ef20, ~4 KB below the `0x90000` wall.
|
|
|
|
|
|
|
+ one WM loop. The 4 KB save buffer and the cursor code (~8 KB in all) are included in
|
|
|
|
|
+ `_end` ~0x8bf20, ~16 KB below the `0x90000` wall.
|