Page 1 of 1

You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 9:06 am
by vbbrett
I've been reading around the internet for months about OS development. I've seen and read all the sites on it. So, now I've started trying to do something. Problems right away, of course, but I kinda expected that from what I heard. Okay, I've found that John Fines stuff is quite good. So, I am using one of his boot loaders,but I would like to write my own. I know this is a big job, but I would rather see my name as the programmer than use someone elses code.
It's quite perplexing as it is in understanding NASM, but if someone would write a tut or direct me to one, I'd be quite pleased. I have written some small stuff in C, but I don't quite like running my kernel in DOS or by using grub. So, if someone could give some info on exactly how I could go about it.....If you ever checked, theres practically no info on the web thats simple to understand on how to boot my kernel.
Ohh, and I've read your 'Read this first' post in this forum.
Brett

Re:You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 9:30 am
by anonymous
Check out crazybuddha's "baby steps" tutorials right here on this board... just do a search!

Re:You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 10:38 am
by mystran
vbbrett wrote: Okay, I've found that John Fines stuff is quite good. So, I am using one of his boot loaders,but I would like to write my own.
Please consider using GRUB anyway.
Grub is a pure bootloader, it's not like using DOS or anything.
Grub can load pretty much every os, either using Multiboot standard, using a chainloader, or with special support it has for loading Linux (and some *BSD's I think).

Using multiboot, you can even get GRUB to give you some information like BIOS memory maps, and it can load modules for you, so in a sense, you get to start right from writing a kernel. Still, after GRUB's loaded your kernel, you don't need to care about it's existence anymore.

The nice thing then, is that it instantly enables you to load your kernel from floppies, different kinds of hard disks, network...

Re:You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 10:52 am
by vbbrett
Okay, so I'll use Grub. I find that I have to compile it in Linux. I have linux, but am not a big wiz with it. I can do almost anything possible under windows, but linux, like I said, is a different story.
Do I HAVE to compile under linux? How could I 'install' it into my test computer?
Brett

Re:You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 11:21 am
by Pype.Clicker
http://www.osdev.org/osfaq2/ has a nice section about installing GRUB, including a pre-compiled disk image that you just need to write to a floppy, iirc.

Re:You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 11:36 am
by bubach
It?s funnier to write your own.. ;)
Look at: http://www.osdev.org/osfaq2/index.php/FAT12%20document
And at the FAT12 thread: http://www.mega-tokyo.com/forum/index.p ... eadid=5490

/ Christoffer

Re:You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 1:01 pm
by ASHLEY4
The trouble with GRUB'S is that it takes a simple boot loader, and makes it complicated,most people have better things to do with there time, Than learn how to use a unfriendly boot loader, how many time i see this "I have problem with GRUBS" in this forum, So when you get tired
trying to understand grubs ,go get "bootprog.zip" from here

http://alexfru.chat.ru/epm.html

It loads a exe or com file from the floppy ,you can use the floppy as a normal floppy Just complie you kernel as a exe/com and put on the disk,That's it,keep it SIMPLE.
You take a 0 & 1 ,very simple and you put them togever and you endup with great programs like bootprog.

It's like nasm great assembler ,but to make a exe you need a linker with FASM to make exe you do this

c:\fasm kernel.asm kernel.exe

And you have a exe.
So keep it simple and add and Learn

ASHLEY4.

Re:You guys must get real bored of this question.

Posted: Sat Mar 20, 2004 11:53 pm
by bkilgore
I dont think GRUB makes it that complicated...in fact, for me, it made my life a while lot easier. After adding a few lines of code to the kernel to make it multiboot compliant:

Code: Select all

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MultiBoot header
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MULTIBOOT_PAGE_ALIGN   equ 1<<0
MULTIBOOT_MEMORY_INFO  equ 1<<1

MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO
CHECKSUM               equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)

; The Multiboot header (in NASM syntax)
align 4
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd CHECKSUM
i just installed grub on a floppy and i was able to completely forget about bootloading. Whenever i rebuild my kernel i just copy the .elf to the floppy and know that i wont have to go tweaking my bootloader trying to get it to work. Like many others i started by writing my own bootloader, and I understand opinions on both sides about whether or not you should start there, but eventually it was more trouble than it was worth and delayed me from actually working on the kernel. So don't be scared by the large size and seeming complexity of the program, just follow a tutorial (this is the one i used), spend a few hours getting it working the first time, and forget about it.

Re:You guys must get real bored of this question.

Posted: Sun Mar 21, 2004 1:15 am
by Ozguxxx
I think there should be a counter opinion so that people can decide from fairly presented ideas. You can also spend some hours to convert a simple fat12 bootloader into what you want and then forget about it until some not very near future. After you have some working pmode floppy driver you can throw away real mode bootloader and write a new bootloader that loads kernel anywhere in ram and turn into pmode and start working at 1 Gb. You will just be some later than grub users in the way that they go directly into kernel developing but you will have to deal with some bootloader problems, well I must tell sometimes they become really annoying but not solvable, but at the end you can proceed in some way with your own bootloader. I know becuase I am doing in that way. Again i dont tell you to write your own bootloader, i just wanted a fair discussion.

Re:You guys must get real bored of this question.

Posted: Sun Mar 21, 2004 1:22 am
by ASHLEY4
Long tut for bootprog:

Put a formated floppy in the A drive
Type: C:\bootable boot12.bin A:
at the Dos prompt
za za za za za
and we are done :D.

Put your kernel on floppy (default name startup.bin) and reboot, That's it.
These also one for a fat16 booting from HD.

PS.You have just saved 2 hours.

ASHLEY4.

Re:You guys must get real bored of this question.

Posted: Mon Mar 22, 2004 6:08 am
by Pype.Clicker
ASHLEY4 wrote: PS.You have just saved 2 hours.
ASHLEY4.
provided that you have a DOS prompt ;) Also, what 'kibd' of kernel can 'bootprog' handle ? real or pmode ? ...

most 'problems with GRUB' comes from the fact ppl do not rtfm ;)