Просмотр исходного кода

Add 'make monitor' serial tail; clean CRLF in boot banner

Johannes Zellner 1 месяц назад
Родитель
Сommit
18df559309
3 измененных файлов с 14 добавлено и 3 удалено
  1. 7 1
      AGENTS.md
  2. 6 1
      Makefile
  3. 1 1
      kernel.c

+ 7 - 1
AGENTS.md

@@ -98,7 +98,13 @@ Wire protocol (host → target, sent immediately; no handshake):
 make dev            # builds kernel.bin, computes kernel_main via nm, sends
 make dev            # builds kernel.bin, computes kernel_main via nm, sends
 ```
 ```
 The reload is automatic. On boot the kernel prints `Nebs OS v<version> booted`
 The reload is automatic. On boot the kernel prints `Nebs OS v<version> booted`
-to COM1, so a serial monitor can confirm the new build headlessly.
+to COM1, so a serial monitor can confirm the new build headlessly:
+
+```sh
+make monitor       # tail the serial line (picocom; Ctrl-A Ctrl-X to exit)
+```
+Run it in a second terminal, then `make dev` in the first — each reload prints
+the `... booted` line.
 
 
 **One-time install onto a 9600-baud machine (no floppy):**
 **One-time install onto a 9600-baud machine (no floppy):**
 ```sh
 ```sh

+ 6 - 1
Makefile

@@ -13,7 +13,7 @@ ASFLAGS  = --32
 BOOT_LDFLAGS   = -T linker.ld -nostdlib -m elf_i386
 BOOT_LDFLAGS   = -T linker.ld -nostdlib -m elf_i386
 KERNEL_LDFLAGS = -T kernel.ld -nostdlib -m elf_i386
 KERNEL_LDFLAGS = -T kernel.ld -nostdlib -m elf_i386
 
 
-.PHONY: all clean run run-floppy run-usb run-serial floppy usb space prog bootstrap dev
+.PHONY: all clean run run-floppy run-usb run-serial floppy usb space prog bootstrap dev monitor
 
 
 all: floppy.img usb.img final.bin root.img
 all: floppy.img usb.img final.bin root.img
 
 
@@ -259,6 +259,11 @@ run-serial:
 	@echo "Press Ctrl-A Ctrl-X to exit picocom."
 	@echo "Press Ctrl-A Ctrl-X to exit picocom."
 	picocom $(SERIAL_DEV) --baud $(SERIAL_BAUD)
 	picocom $(SERIAL_DEV) --baud $(SERIAL_BAUD)
 
 
+monitor:
+	@echo "Watching $(SERIAL_DEV) @ $(SERIAL_BAUD) baud (Ctrl-A Ctrl-X to exit)."
+	@echo "Each 'make dev' reload prints: Nebs OS v<version> booted"
+	picocom $(SERIAL_DEV) --baud $(SERIAL_BAUD)
+
 send: $(PROGRAM).bin send_serial
 send: $(PROGRAM).bin send_serial
 	@echo "Sending $(PROGRAM).bin via serial..."
 	@echo "Sending $(PROGRAM).bin via serial..."
 	./send_serial $(SERIAL_DEV) $(SERIAL_BAUD) $(PROGRAM).bin
 	./send_serial $(SERIAL_DEV) $(SERIAL_BAUD) $(PROGRAM).bin

+ 1 - 1
kernel.c

@@ -131,7 +131,7 @@ void kernel_main(void)
 
 
 	serial_init(SERIAL_COM1);
 	serial_init(SERIAL_COM1);
 	serial_ring_init();
 	serial_ring_init();
-	serial_puts(SERIAL_COM1, "\r\n" OS_NAME " v" OS_VERSION " booted\r\n");
+	serial_puts(SERIAL_COM1, "\n" OS_NAME " v" OS_VERSION " booted\n");
 	io_init();
 	io_init();
 	idle_init();
 	idle_init();
 	timer_init();
 	timer_init();