[OS]
OSの作成
Osaskをベースに独自のOSを作成したい。
ブートローダーの作成
以下を参考にして
準備
- Windows
- msys2 + pacman環境を用意してnasmもインストールすると楽です
→ MinGW … Windowsでのmsys2環境構築について
- Linux
- お使いのパッケージシステムにてnasmをインストールしましょう
- Mac OS X
- お使いのパッケージシステムにてnasmをインストールしましょう
nasm
bits 16 jmp short boot_start nop ;; BPB db "BOOT " dw 512 ; Sector size db 1 ; Cluster size dw 1 ; FAT Head db 2 ; FAT Count dw 224 ; Root entries dw 2880 ; Disk sectors db 0xF0 ; Media type dw 9 ; FAT length dw 18 ; Sectors per track dw 2 ; Heads dd 0 ; BPB Position dd 0 ; Disk sectors(32bit) db 0 ; Drive # db 0 ; Reserved db 41 dd 0xFFFFFFFF ; Serial Number db 'NONE ' ; Disk name db 'FAT12 ' ; File system boot_start: hlt jmp boot_start times 510-($-$$) db 0 dw 0x55AA times (2879*512) db 0
- コンパイル
$ nasm boot.asm -o boot.img -l boot.lst
出来上がったイメージファイルをVirtualBoxに読み込ませれば、もうブートローダーの完成です。
文字列の描画
あ
参考サイト
- x86なプログラミングメモ
- Basic boot loader using GAS
- ld: cannot perform PE operations on non PE output file 'a.exe'.