A story about a small 6 who doesn't do it steadily and completes "Introduction to OS self-made" with qemu (virtualbox). Day 2 (Give up)

I didn't post it for a long time, but I finally posted it. Come on, it ’s fun today.

Link

Day 1 https://qiita.com/gorira_tatsu/items/0b5aec93aa74a8c89107 Day 2 (before) https://qiita.com/gorira_tatsu/items/c1ae1d15c2946a90e042 Day 2 (middle) https://qiita.com/gorira_tatsu/items/6312385a5ad8f02daf68 Sample file https://book.mynavi.jp/supportsite/detail/4839919844.html Reference "Run" Introduction to OS self-made in 30 days "on macOS Catalina" https://qiita.com/noanoa07/items/8828c37c2e286522c7ee

What I did last time

I copied the register relationship in full and looked back. For details, see the previous https://qiita.com/gorira_tatsu/items/6312385a5ad8f02daf68

Happy new year

Happy new year. I look forward to working with you again this year. It's a good day for development today. By the way, January 1st is my birthday. I'm 12 years old this year! I will return to the story, but from now on, I will write only the practical skills. At this rate, I can't move forward and it's related to my motivation. By the way, it will be difficult to call with virtualbox from now on, so I will do it with qemu. I will switch again when my knowledge comes to that side. Please install qemu with brew install qemu. I got an error because I didn't write the path of brew: beer: to .bash_profile when installing. On the contrary, I wonder if it could be used until now ...

Organize to create only boot sectors

Let's organize it so that only the boot sector is created.

First, helloos.nas cut the back part. The boot sector only needs to be the first 512 bytes. So this source is now a boot sector only source, so the source name is also changed to ipl.nas.

So let's take a look at hellos4 on project / 02_day and compare what has changed. If you do not have the Sample File, please click here. スクリーンショット 2020-01-04 21.52.35.png

So I modified asm.bat and changed the output to ipl.bin

I wrote that, so I will also look at this. スクリーンショット 2020-01-05 10.32.06.png

You are instructing nask.exe to convert (compile) ipl.nas to ipl.bin. I thought while working, "Hey wait (Edokko). What is lst? What is asm.bat." But first, asm.bat is a batch file. When executed, the command written in the file will execute the same command as the command prompt of windows (is it correct?). Next, about lst, this is a text file that allows you to easily check which instruction was translated into which machine language. It was written. Now you can go next with confidence. (Read it properly)

And I made makeimg.bat. This is a batch file that creates a disk image helloos.img based on ipl.bin.

Let's see this too. ![Screenshot 2020-01-05 11.40.17.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/534096/c09ff53b-e039-6b1c-66e9- f3aa813890de.png) It's a batch file that uses the author's disk image management tool edimg.exe. So the procedure from compilation to test execution is

!cons > asm > makeimg > run

It will be. Well, it doesn't matter because it's a mac. For mac, use Mtools. Mtools can be installed with brew: beer :.

$ brew install mtools

$ mformat -f 1440 -C -B ipl.bin -i helloos.img ::

It is like this. For the time being, the boot sector edition ends here. The sharpness is good, and there are more problems with mochi, so this time ~

/|_________ _ _ 〈  To BE CONTINUED?…//// |  \| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄~ ~  ̄

Recommended Posts