Skip to content

Commit b8db00f

Browse files
committed
VM runs from floppy ISO
1 parent 2210d9b commit b8db00f

9 files changed

Lines changed: 10 additions & 3 deletions

File tree

OS.iso

-1.41 MB
Binary file not shown.

boot.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ GDT_start:
118118
mov ebp, 0xF0000
119119
mov esp, ebp
120120

121+
; mov edx, 0xb8000
122+
; mov al, 0x41
123+
; mov [edx], al
124+
; jmp $
121125
jmp kernel_address
122126

123127
times 510-($-$$) db 0 ; Fills binary with 0 to keep the offset of 512

build/OS.bin

-8 Bytes
Binary file not shown.

build/full_kernel.bin

-8 Bytes
Binary file not shown.

build/kernel.o

-44 Bytes
Binary file not shown.

iso/flash.img

-1.41 MB
Binary file not shown.

iso/floppy.img

0 Bytes
Binary file not shown.

kernel/kernel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ extern void main()
55
printformat("Hey! I am writing straight to video memory", 0x0f);
66
coords pos = {10, 0};
77
set_cursor_position(pos);
8+
while (1) {};
89
return;
910
}

run.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ if [ $? != 0 ] ; then
130130
exit 7
131131
fi
132132

133-
/bin/dd if=/dev/zero of=iso/flash.img bs=1024 count=1440
134-
/bin/dd if=build/OS.bin of=iso/flash.img seek=0 count=20 conv=notrunc
133+
/bin/dd if=/dev/zero of=iso/floppy.img bs=1024 count=1440
134+
/bin/dd if=build/OS.bin of=iso/floppy.img seek=0 count=20 conv=notrunc
135135
/usr/bin/genisoimage -quiet -V 'SK-OS' -input-charset iso8859-1 -o OS.iso -b floppy.img -hide floppy.img iso/
136136

137-
/usr/bin/qemu-system-x86_64 -drive format=raw,file="build/OS.bin",index=0,if=floppy, -m 128M
137+
# Uncomment this to run straight raw binary kernel
138+
# /usr/bin/qemu-system-x86_64 -drive format=raw,file="build/OS.bin",index=0,if=floppy, -m 128M
139+
/usr/bin/qemu-system-i386 -cdrom OS.iso

0 commit comments

Comments
 (0)