From c002e8b250ecb418d8eaa19ffd9df625e3311843 Mon Sep 17 00:00:00 2001 From: "Pierre-Emmanuel Gob." Date: Fri, 18 Sep 2026 11:17:27 +0200 Subject: [PATCH] Removed uneccesary documentation --- README.md | 13 +------------ kernel/arch/x86_64/console.c | 13 ++++++------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index da1e34f..1030525 100644 --- a/README.md +++ b/README.md @@ -56,17 +56,6 @@ A QEMU window opens and you should see this: ![Nadir booting in QEMU](docs/assets/boot.png) -Notes: - -- `nadir.img` is a raw floppy image: the 512-byte boot sector first, then the kernel. `-fda` boots it as a BIOS floppy; QEMU's default firmware loads the sector at address `0x7C00` and executes it in 16-bit real mode. -- `build/` and `nadir.img` are generated artifacts ignored by git. `make clean` removes them. -- The C kernel builds with plain host `gcc` and freestanding flags for now (see `Makefile`); a dedicated `x86-64-elf` cross-compiler is the planned next step. -- Running over SSH or in a bare terminal? `make run` needs a window; boot headless instead: - ```bash - qemu-system-x86_64 -fda nadir.img -display curses - ``` - Quit with `Ctrl-A` then `X`. - ### Troubleshooting | Symptom | Cause | @@ -86,7 +75,7 @@ The full memory map lives in the header comment of `kernel/arch/x86_64/boot.asm` ## Contributing -Every contribution is welcome. Please fork and send a pull request if you wish to contribute. You will be credited at the end of this very file. Please see the [CONTRIBUTING](CONTRIBUTING.md) file for more information. +Every contribution is welcome. Please fork and send a pull request if you wish to contribute. You will be credited at the end of this very file. Please see [CONTRIBUTING](CONTRIBUTING.md) for more information. ## License diff --git a/kernel/arch/x86_64/console.c b/kernel/arch/x86_64/console.c index 3d4decd..6e13ef6 100644 --- a/kernel/arch/x86_64/console.c +++ b/kernel/arch/x86_64/console.c @@ -1,4 +1,4 @@ -/* Nadir console: VGA text-mode driver (see console.h). */ +/* VGA text-mode driver (see console.h). */ #include @@ -9,14 +9,13 @@ #define VGA_ADDR 0xB8000 #define COLOR_DEFAULT 0x0FU /* white on black */ -/* Cursor position. Lives in BSS, zeroed by stage 2 before kmain runs. */ +/* Cursor position. Lives in BSS. */ static uint8_t cursor_row; static uint8_t cursor_col; -/* Text buffer: one 16-bit cell per character, low byte is the ASCII code, +/* Text buffer, one 16-bit cell per character, low byte is the ASCII code, * high byte is the color attribute. `volatile` so the compiler keeps every - * store in order: this is memory-mapped I/O, and dropped or reordered - * writes would corrupt the screen. */ + * store in order. */ static volatile uint16_t *const vga = (uint16_t *)VGA_ADDR; /* Move every line one row up and blank the last line */ @@ -52,12 +51,12 @@ void console_putchar(char c) (uint16_t)((COLOR_DEFAULT << 8) | c); cursor_col++; if (cursor_col >= VGA_WIDTH) { - /* Past the right edge: wrap to the next line. */ + /* Wrap to the next line. */ cursor_col = 0; cursor_row++; } } - /* Past the bottom line: scroll and stay on the last line. */ + /* Past the bottom line scroll and stay on the last line. */ if (cursor_row >= VGA_HEIGHT) { scroll(); cursor_row = VGA_HEIGHT - 1;