OK.
Let�s build and test the project in mac os. As you see, I have copied the boot folder in the desktop.
We have all the files we need in this folder.
The boot image file is the blank 10 mb image
we created in lecture working with mac os. Be sure to place the image in the boot folder
before building the project.
Now we open the terminal.
And chang the directory to the boot directory.
and type ./build.sh
Press enter.
OK, the binary file is copied into boot.img
In the bochs configuration file.
we can see the image path is pointing to the boot image file.
OK.
In Terminal,
we type bochs
press enter.
and the default number is 6, which is begin simulation, so we press enter.
in the command prompt, we type c to continue.
And hello is printed on screen.
write boot image to the USB thumb drive.
So we insert a USB thumb drive, and in the terminal we check the device list using the command diskutil.
.
The name of the device in this example is dev disk2
We use the same command, dd
The input file, boot.img and output file dev disk2 and the block size is set to 512 bytes.
We write 1 block of data into boot image.
Once again, we need to check the output file is the correct one,
,
and press enter.
Here we need to add sudo.
And press enter.
OK.
The boot image has been written into the USB thumb drive, and we are done.
With USB flash drive ready to use, we insert it into the test computer and boot the computer.
Because we are running in legacy bios mode,
we have to make sure the csm support is enable if the motherboard has uefi system,
which should be enabled by default.
As you can see, this is the BIOS interface in my computer.
We navigated to BIOS option.
And CSM is enabled. Also BIOS interface could be different in your machine,
so you need to check whether the CSM option is at in your computer.
OK, we exit and reboot the computer.
Since we didn't set up boot device priority, we open boot menu. In this menu,
we choose which device we want to boot.
Since this is a test computer which has no hard disk, the only option is the USB flash drive
I just inserted.
So we press enter.
If everything goes as expected, we will see
hello is printed.
That's it for this lecture.
See you in the next video.