Skip to content

Instantly share code, notes, and snippets.

@fzn0x
Created July 12, 2024 23:29
Show Gist options
  • Save fzn0x/17218a40d58f009d7ecfe1ac6d4e615e to your computer and use it in GitHub Desktop.
Save fzn0x/17218a40d58f009d7ecfe1ac6d4e615e to your computer and use it in GitHub Desktop.
Write my first OS - Hello World (part 1) - bootloader.asm
[ORG 0x7C00]
mov ah, 0x0E
mov al, 'H'
int 0x10
mov al, 'e'
int 0x10
mov al, 'l'
int 0x10
mov al, 'l'
int 0x10
mov al, 'o'
int 0x10
mov al, ','
int 0x10
mov al, ' '
int 0x10
mov al, 'W'
int 0x10
mov al, 'o'
int 0x10
mov al, 'r'
int 0x10
mov al, 'l'
int 0x10
mov al, 'd'
int 0x10
mov al, '!'
int 0x10
jmp $
times 510 - ($-$$) db 0
dw 0xAA55
@fzn0x
Copy link
Author

fzn0x commented Jul 12, 2024

Verify the bootloader by identifying 55 aa

fzn0x@DESKTOP-69TAUPC:/mnt/d/Projects/simple-os$ hexdump -C os.img | head -n 20
00000000  b4 0e b0 48 cd 10 b0 65  cd 10 b0 6c cd 10 b0 6c  |...H...e...l...l|
00000010  cd 10 b0 6f cd 10 b0 2c  cd 10 b0 20 cd 10 b0 57  |...o...,... ...W|
00000020  cd 10 b0 6f cd 10 b0 72  cd 10 b0 6c cd 10 b0 64  |...o...r...l...d|
00000030  cd 10 b0 21 cd 10 eb fe  00 00 00 00 00 00 00 00  |...!............|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200  55 89 e5 83 ec 10 c7 45  f8 65 10 00 00 c7 45 f4  |U......E.e....E.|
00000210  00 80 0b 00 c7 45 fc 00  00 00 00 eb 2c 8b 55 fc  |.....E......,.U.|
00000220  8b 45 f8 8d 0c 02 8b 45  fc 01 c0 89 c2 8b 45 f4  |.E.....E......E.|
00000230  01 c2 8a 01 88 02 8b 45  fc 01 c0 8d 50 01 8b 45  |.......E....P..E|
00000240  f4 01 d0 c6 00 07 ff 45  fc 8b 55 fc 8b 45 f8 01  |.......E..U..E..|
00000250  d0 8a 00 84 c0 75 c6 f4  eb fd 55 89 e5 e8 9e ff  |.....u....U.....|
00000260  ff ff 90 5d c3 48 65 6c  6c 6f 2c 20 57 6f 72 6c  |...].Hello, Worl|
00000270  64 21 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |d!..............|
00000280  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00168000

@fzn0x
Copy link
Author

fzn0x commented Jul 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment