From afc9ed293587bcd78ab81eea474620a0d6202369 Mon Sep 17 00:00:00 2001 From: jdah <20308439+jdah@users.noreply.github.com> Date: Thu, 22 Apr 2021 14:52:58 +0200 Subject: [PATCH] Update README.md --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9d14978..cc7d950 100644 --- a/README.md +++ b/README.md @@ -19,29 +19,35 @@ - [ToaruOS](https://toaruos.org) - [James Molloy's Kernel Development Tutorials](http://www.jamesmolloy.co.uk/tutorial_html/) -#### Building & Running +### Building & Running ~~**NOTE**: This has *only* been tested in an emulator. Real hardware might not like it.~~ EDIT: this is not true anymore! [@parkerlreed has run this on a Thinkpad T510](https://github.com/jdah/tetris-os/issues/5#issuecomment-824507979). -##### Mac OS +#### Mac OS For the cross-compiler: `$ brew tap nativeos/i386-elf-toolchain && brew install i386-elf-binutils i386-elf-gcc` ``` $ make iso $ qemu-system-i386 -drive format=raw,file=boot.iso -d cpu_reset -monitor stdio -device sb16 -audiodev coreaudio,id=coreaudio,out.frequency=48000,out.channels=2,out.format=s32 ``` -##### Unix-like +#### Unix-like You should not need a cross-compiler in *most* cases as the `gcc` shipped in most linux distros will support `i386` targets. [If this isn't the case for you, read here about getting a cross-compiler.](https://wiki.osdev.org/GCC_Cross-Compiler) -To run, the same command as Mac OS, but try with `pulseaudio` as the audio device. +To run: +``` +$ make iso +$ qemu-system-i386 -drive format=raw,file=boot.iso -d cpu_reset -monitor stdio -device sb16 -audiodev pulseaudio,id=pulseaudio,out.frequency=48000,out.channels=2,out.format=s32 +``` + +If you have sound device issues, try building without the `#define ENABLE_MUSIC` in `main.c` and running with `$ qemu-system-i386 -drive format=raw,file=boot.iso`. If you're having issues with no image showing up/QEMU freezing, this is a known bug with QEMU SB16 emulation under GTK. [Please read what @takaswie has written in #2 for a workaround](https://github.com/jdah/tetris-os/issues/2#issuecomment-824773889). -##### Windows +#### Windows Absolutely no idea. Maybe try WSL. -##### Real hardware +#### Real hardware You probably know what you're doing if you're going to try this. Just burn `boot.iso` onto some bootable media and give it a go. If things break, try disabling all of the music (remove `#define ENABLE_MUSIC` in `main.c`) since you *probably* don't have something with a SB16 in it.