OS development beginner
Posted: Tue Jun 18, 2002 11:00 pm
Hello
I am working with Red Hat Linux 7.2 and i am just beginning to experiment with OS development.
Here are the steps that i have taken.
1) Create a very small assembly file myos.s which contains the following lines:
( I know that this code will not do anything useful, but i just want to see if i can get this code loaded into memory.)
BOOTSEG = 0X07C0
INITSEG = 0X90000
.code16
.text
.global _start
_start:
movw $BOOTSEG, %ax
movw %ax,%ds
movw $INITSEG, %ax
movw %ax, %es
movw $256, %cx
2) assemble myos.s with the following line:
as -o myos.o myos.s
3) link object file myos.o with the following line:
ld -Ttext 0x0 -s --oformat binary -o myos myos.o
4) I move the file myos to the directory /boot
5) In the /boot/grub directory i edit the grub.conf file and add the following lines:
title MyOS
root (hd0,0)
kernel /myos
6) Then I reboot the system, and select MyOS to be loaded.
After selecting MyOS i get the following message:
Booting 'MyOS'
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
kernel /myos
Error 13: Invalid or unsupported executable format
Press any key to continue...
My question is how do i get a small nugget of code loaded into memory and executed (even if does nothing useful).
Thank You
Michael Morrison
I am working with Red Hat Linux 7.2 and i am just beginning to experiment with OS development.
Here are the steps that i have taken.
1) Create a very small assembly file myos.s which contains the following lines:
( I know that this code will not do anything useful, but i just want to see if i can get this code loaded into memory.)
BOOTSEG = 0X07C0
INITSEG = 0X90000
.code16
.text
.global _start
_start:
movw $BOOTSEG, %ax
movw %ax,%ds
movw $INITSEG, %ax
movw %ax, %es
movw $256, %cx
2) assemble myos.s with the following line:
as -o myos.o myos.s
3) link object file myos.o with the following line:
ld -Ttext 0x0 -s --oformat binary -o myos myos.o
4) I move the file myos to the directory /boot
5) In the /boot/grub directory i edit the grub.conf file and add the following lines:
title MyOS
root (hd0,0)
kernel /myos
6) Then I reboot the system, and select MyOS to be loaded.
After selecting MyOS i get the following message:
Booting 'MyOS'
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
kernel /myos
Error 13: Invalid or unsupported executable format
Press any key to continue...
My question is how do i get a small nugget of code loaded into memory and executed (even if does nothing useful).
Thank You
Michael Morrison