From ae070757a00d0aeab453396458d6743d39e14de4 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Sat, 24 Aug 2019 00:00:04 +0000 Subject: [PATCH] serial: OK, works on QEMU --- Makefile | 2 +- README.adoc | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 03a48ac..6b1eb2b 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ GAS_EXT ?= .S NASM_EXT ?= .asm OBJ_EXT ?= .o OUT_EXT ?= .img -QEMU ?= qemu-system-i386 -drive 'file=$(RUN_FILE),format=raw' -smp 2 +QEMU ?= qemu-system-i386 -drive 'file=$(RUN_FILE),format=raw' -serial mon:stdio -smp 2 RUN ?= bios_hello_world RUN_ARGS ?= -soundhw pcspk TMP_EXT ?= .tmp diff --git a/README.adoc b/README.adoc index ae2096f..d558c99 100644 --- a/README.adoc +++ b/README.adoc @@ -2116,19 +2116,24 @@ What the heck is a serial in the real world: https://unix.stackexchange.com/ques Currently all text output is done the display, and that was a newbie design choice from before I knew the serial existed. The serial is just generally more minimal and elegant than the display, and should have been used instead. -TODO: get working on QEMU, working on Bochs: +.... +./run bios_hello_world_serial +cat bios_hello_world_serial.tmp.serial +.... + +On QEMU, we see the serial output on the host terminal: + +.... +hello world +.... + +and on Bochs we redirect it to a file: .... ./run bios_hello_world_serial bochs cat bios_hello_world_serial.tmp.serial .... -The file content: - -.... -hello world -.... - Source: link:bios_hello_world_serial.S[] Bibliography: @@ -2140,7 +2145,7 @@ This would open up: * gem5 benchmarking and exploration, currently blocked on https://stackoverflow.com/questions/50364863/how-to-get-graphical-gui-output-and-user-touch-keyboard-mouse-input-in-a-ful/50364864#50364864 * automated unit tests. Ha, like I'm gonna be that diligent! -* easily working on ARM in a more uniform way +* easily working on ARM in a more uniform way to prepare for the move in to https://github.com/cirosantilli/linux-kernel-module-cheat/tree/87e846fc1f9c57840e143513ebd69c638bd37aa8#baremetal-setup === Macros vs functions