"30 Days Homemade Operating System" (Written by Hikaru Kawasaki) supporting code adaptation. Because the author used a set of non-standard tools he wrote himself and could not run on a non-Windows platform, this project uses NASM, GCC, Qemu and other tools to compile and run based on the original code.
This project has completed the contents of the 0th to 28th day (excluding the Japanese display part on the 28th day), and the main implementation of the project has been completed. Because the content of the last two chapters of the book is more application-oriented, it is not implemented in this project. Interested friends can continue to complete it based on the previous basis.
nasmgccbinutilsqemu-system-i386mtoolsgdb (debug use)The default Xcode Command Line Tools use gcc as an alias for clang under MacOS. Clang has not been tested in this project implementation, and there may be problems.
It is recommended to use x86_64-elf-gcc toolchain for compilation under Mac. You can use brew install x86_64-elf-gcc x86_64-elf-binutils x86_64-elf-gdb to install.
Enter the corresponding folder and run with the following command:
$ make qemu
# 若使用工具链包含前缀,如x86_64-elf-,可以使用GCCPREFIX
$ make qemu GCCPREFIX=x86_64-elf- To debug using GDB, set DEBUG :
$ make qemu DEBUG=1app : application source codeinclude : System kernel header filekernel : system kernel codelibc : Simple C standard library partial implementation strcmpstrncmpRefer to xv6 implementation:
vsprintfsprintfFrom "C Programming Language":
randThis project will not continue to add content from Day 29 and Day 30. Interested friends can continue to read the subsequent chapters.
io_sti instead of io_stihlt __alloca is invalid in day 28, sosu2 cannot run The copyright of the code in the project mainly belongs to the original author. I only make partial modifications to the code for the part that cannot be directly run.