A repo for learning the basics of OS development.
This project is building a hobby OS for AMD64. Here are instructions to get a development environment working on an ARM64 macOS machine (I am using an M1 Mac with macOS v14).
UTM allows you to run virtual machines (VMs) with different architectures on your Mac. You can buy it from the app store or download it for free from GitHub: UTM v4.4.5
Download and unzip the Debian 12 (Rosetta) preset from the UTM gallery.
- In UTM choose
Create a New Virtual Machine
>Open...
and select your preset. - Right click on the machine and choose
Edit
to change the VM settings. - In the
Network Mode
section selectBridged (Advanced)
for internet access. - In the
Sharing
section chooseAdd
and navigate to./mount
for a shared directory between the host machine (your Mac) and the guest machine (the Debian VM). - Also in the
Sharing
section check theAdd read only
checkbox, chooseAdd
and navigate to./
for readonly access to this repo from inside the VM. - Increase the VM’s RAM and disk space if required.
- Start the VM and log in as user
debian
with passworddebian
. - Open a terminal in the VM.
- Run the installation script:
/media/share/learn-os/install.sh
. - Make a writable local clone of the repo:
git clone file:///media/share/learn-os
.
Through the VM GUI I also like to change some other things:
Settings
>Screen
> Turn off screen lock and set blank screen delay toNever
.- Dark mode for OS.
- Pin Terminal application to dock for easy access via
Cmd + 1
. - Dark mode for Terminal.
It will probably be more convenient in general to interact with the VM via SSH from a terminal running on your host machine. The installation script prepared this for you. Find the local IP address of the VM from the installation script output, then do the following on your host machine:
-
Install your host’s SSH public key on the VM:
ssh-copy-id debian@ip
(whereip
is the VM’s local IP). -
Add this to your host’s
~/.ssh/config
file (whereip
is the VM’s local IP):Host learn-os HostName ip User debian
-
SSH into the VM:
ssh learn-os
.
NASM:
GCC:
ld:
Bochs:
GDB:
Make:
- dd: