Attempt 2 #2
Reference in New Issue
Block a user
Delete Branch "attempt-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For attempt #2, I will use Gemini 3 Pro using Copilot
I'm switching to Opus as my Github Copilot license will be replaced by the enterprise version. I can thus use up all my tokens
- Created two-level x86 paging (page directory + page tables) with 4 KiB pages. - Identity maps all detected physical memory in two phases: 1) Static: first 16 MiB using 4 BSS-allocated page tables (avoids chicken-and-egg with PMM bitmap in BSS). 2) Dynamic: memory above 16 MiB using PMM-allocated page tables, created before paging is enabled so physical addresses still work. - Provides kernel heap at 0xD0000000–0xF0000000 for virtual page allocation. - API: paging_map_page, paging_unmap_page, paging_alloc_page, paging_free_page, paging_get_physical. - Added pmm_get_memory_size() to expose detected RAM for paging init. - Kernel tests paging by allocating a virtual page, writing 0xDEADBEEF, and reading it back, then freeing it. - Added documentation in docs/paging.md. Tested: boots and passes paging test with both 4 MiB and 128 MiB RAM in QEMU.- Created VGA driver that writes to the 0xB8000 text-mode framebuffer. Supports 80x25 display with 16 foreground/background colors, scrolling, hardware cursor updates, and special characters (\n, \r, \t, \b). - Provides vga_puts, vga_putchar, vga_put_hex, vga_put_dec, vga_set_color. - Displays boot banner ("ClaudeOS v0.1 booting...") on screen clear. - vga_show_mem_stats() prints total RAM, kernel start/end addresses, and kernel size on the VGA display during boot. - Registered as the first driver using REGISTER_DRIVER, proving the driver framework works end-to-end (probe -> init lifecycle). Tested: driver loads successfully, debug port confirms vga probe/init.While adding keyboard support, the vga output was broken. I have to steer Opus 4.6 to fix this
When GRUB is configured with multiboot2, it may provide a graphical (RGB) framebuffer instead of legacy VGA text mode. This happens on UTM/QEMU on macOS and other configurations where the bootloader switches to a pixel-based display. - Parse multiboot2 framebuffer tag in kernel_main to detect display mode - Identity-map the framebuffer address (often at 0xFD000000+) after paging is enabled, with write-through caching - Add framebuffer.h describing the boot-time display info - Embed 8x16 VGA bitmap font (font8x16.h) for pixel-mode rendering - Rewrite VGA driver to support both text mode and pixel mode: - Text mode: unchanged behavior writing to 0xB8000 - Pixel mode: renders characters using the bitmap font to the GRUB-provided framebuffer, with proper VGA color palette mapping - Auto-detects mode from fb_info at init time - Multiboot2 header now requests text mode via framebuffer tag, but gracefully falls back to pixel rendering if GRUB provides RGB - Reverted grub.cfg gfxpayload=text (caused display issues on UTM) Tested: boots in both text mode and graphical framebuffer mode.Display fixes for UTM/Mac black screen issue: - Remove MULTIBOOT_HEADER_TAG_FRAMEBUFFER from multiboot2 header (was required, requesting text mode depth=0 which confused GRUB on some platforms) - Add COM1 serial port (0x3F8) output alongside debugcon for UTM serial capture - Change VGA background from black to dark blue for diagnostics - Add early canary write to 0xB8000 ('COS' in magenta) before subsystem init - print_hex now outputs to both debugcon and COM1 New ls command and SYS_READDIR syscall: - SYS_READDIR (10): reads directory entries via VFS - VFS root listing: vfs_readdir handles '/' by iterating mount table - apps/ls: lists CWD contents, appends '/' for directories - apps/libc/syscalls.h: readdir() wrapperOpus fixed the vga output, and PS/2 keyboard works. But the background is now permanently blue instead of black...
Oh well /shrug
The
cdcommand did not work properly. It always interpreted the path as absolute path, creating invalidPWDenv vars. I asked Opus to fix this, and now it works properly.I have to steer it again as no devices are showing up in
/dev. Also, I created a release cause I thought the current version is pretty neat.Create a user-space diskpart utility that can view and modify MBR partition tables on block devices accessible through /dev. Features: - list: displays all 4 partition slots with type, LBA start, size - create <slot> <type> <start> <sectors>: creates a new partition - delete <slot>: removes a partition entry - activate/deactivate <slot>: sets or clears the bootable flag The tool reads sector 0 (MBR) via VFS open/read, modifies the partition table in memory, then writes it back via open/write. Supports hex type codes and provides human-readable type names for common partition types (FAT12/16/32, Linux, NTFS, etc.). Usage: diskpart hdd1 create 1 0C 2048 14336 diskpart hdd1 list diskpart hdd1 delete 2View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.