CSCE611 OS Env Prepare (Macbook M-chip)
This assumes that you have at the very least set up developer tools and Homebrew on your machine.
Step01, GCC Install
In the class, we need to build a unix-like kernel in X86 arch. Because MacBook with M2 chip is arm arch. So, we can’t use the original gcc in homebrew. Fortunate, there is a x86_64-elf-gcc in home-brew repo:
1 | ➜ ~ brew search gcc |
Use brew search gcc in terminal, you can find “x86_64-elf-gcc”. So, use “brew install x86_64-elf-gcc” to install it. Now, you can use “aarch64-elf-gcc” to compail the kernel.
All tool intalled by gcc will be store in this path: /opt/homebrew/Cellar/. So you should heve this “/opt/homebrew/Cellar/x86_64-elf-binutils/2.41_1/bin/x86_64-elf-ld”.
Step2, Tools Install
- Install wget
brew install wget
- Install nasm:
brew install nasm
- Install qemu and bochs:
brew install qemu bochs