New to OS Dev.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Kyretzn

New to OS Dev.

Post by Kyretzn »

Hello, you coding gurus you.

Anywho, Im just putting a post here to say Hi, im a new OS Dever and that if possible, I would like it if someone could take me under their wing and teach me a few things about OS Dev.

Ive written a basic bootloader and such before, but whenever I Called a function in the kernel, it would jump to that function and then crash on the return.

Im not sure why, I figure it must have been a stack problem.
That was a year ago and Im keen to retry OS Development.

I run GCC on Linux, NASM is my Assembler.

Ive read the OSDev Wiki and Ive read through many of the tutorials on Bonafide OS Dev.

Im a decent C++ Programmer and Im just ahead of being a total newb to Assembler. I can code in Assembler aslong as I have a lot of references and Ralf Browns INterrupt list open.

So yeah, If anyone is willing to help me out and teach me, Itd be great.

Thanks!
~Kyretzn
DruG5t0r3

Re:New to OS Dev.

Post by DruG5t0r3 »

welcome to the (as I'm aware of) most visited osdev forum. If you need any teachings, then I guess the only good way would be to ask questions on this forum.
Kyretzn

Re:New to OS Dev.

Post by Kyretzn »

Well, First lesson is that I need to make a bootloader.

Personally, Id like the bootloader to use FAT12. So, I can just drag and drop the Kernel from say, linux or windows onto the Diskette.

But... Im completely unsure how to implement the FAT12 filesystem, I know how to just ... READ the Kernel's code into memory via BIOS I/O functions...

scratch it, I need major help writing a bootloader.

Its silly I know, its just, I learn better with someone kind of teaching me.

Ive been reading for the psat 2 hours on the OSFAQ and scanning through websites about Bootloaders and FAT12.

Quick question though, Can I use GCC on Linux + NASM to make a Bootloader and Kernel? Im sure I can, im just not entirely sure. I mean, I can compile normal applications and such I built myself in GCC easy enough.

~Kyretzn
Crazed123

Re:New to OS Dev.

Post by Crazed123 »

Yes, you can use GCC and NASM. There are just some flags you'll need to pass to the compiler.

And why do you need to make your own bootloader? There are plenty of good ones out there already!
Kyretzn

Re:New to OS Dev.

Post by Kyretzn »

Because I want to be able to put my little OS Diskette in most x86s and be able to run it.

Besides, I want to learn how to do bootloaders.
:)

Most of the Assembler in examples I see, I dont understand.

~Kyretzn
Crazed123

Re:New to OS Dev.

Post by Crazed123 »

For your first reason: Standard bootloaders like GRUB can pretty much boot a hard disk, floppy or sometimes even CD-ROM for any architecture they support.

For your second reason: That's a good reason.

For your final statement: You've got a hell of a lot of learning to do. Get cracking.
Kyretzn

Re:New to OS Dev.

Post by Kyretzn »

Crazed, Do you use MSN? itd be handy if I could ask you questions in realtime. Id learn faster.
:) Im reading NASM docs now.
Interesting.

anddd.. Ive coded a basic little bootloader.
It just starts up.
Jumps to 0000:7C00h
then proceeds to load a sector of data from the disk
then jumps to that sector that it loaded in memory.

Im not sure, but when should I set SS / DS or whatever?
Also, What role to SS and DS play?
Thanks!
~Kyretzn
Crazed123

Re:New to OS Dev.

Post by Crazed123 »

1. I use GAIM, very occasionally.
2. I don't know all the answers.
3. I just answered your other thread.
4. OS called: sleep("Crazed123");
5. Good luck, my best advice is to RTFM, STFW and Read The FAQ. They help loads, in addition to the Intel Manuals.
Kyretzn

Re:New to OS Dev.

Post by Kyretzn »

STFW?
Thanks for answering the other thread, im reading through that part of the FAQ now
~Kyretzn
Ushma

Re:New to OS Dev.

Post by Ushma »

The simple answer to "What is STFW?", is, quite simply, to STFW. :)

http://www.google.com/search?q=STFW
Freanan

Re:New to OS Dev.

Post by Freanan »

It might seem like trying to hide from the problems of coding your own bootloader, but it is really better to just use grub.
And i think grub can boot a kernel from a fat fs too...
It is also rather easy to use.
I also tried to use my own loader (which seemed to work) but my everytime my kernel became bigger then a certain size noting would work anymore. This was because of some problem with the bootloader.
I think it is just more secure to use grub - then you can focus on fixing the n bugs that you will definitely encounter inside your kernel, without having to wonder if it is your kernel's fault or the boot loader's and so on.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:New to OS Dev.

Post by distantvoices »

Kyretzn wrote: Well, First lesson is that I need to make a bootloader.

Personally, Id like the bootloader to use FAT12. So, I can just drag and drop the Kernel from say, linux or windows onto the Diskette.

scratch it, I need major help writing a bootloader.

Its silly I know, its just, I learn better with someone kind of teaching me.

Ive been reading for the psat 2 hours on the OSFAQ and scanning through websites about Bootloaders and FAT12.

~Kyretzn
First, welcome to the realms of debug sessions darker than night!

You will of course need more than average coding knowledge. You'll need inspiration and dedication to get it done :-).

Anyway. You wanna write your own boot loader? Good so, just go ahead. It's a nice experience and a fine entry to development without any supporting libraries. Just keep in mind: There are very good boot loaders outta there, GRUB among them. They do most of that startup and loading work for you and come along with fs interpreters. You might want to use one of them after some time spent with your own one. ;-)

For reference, just Search the Fcuking Web for John Fine's website. Also, Christopher Giese's website offers quite some interresting stuff. You may want to check the quick-linkz topic in the osdev forum for further references. ;-) Or just search the forum for "boot loaders"

Just be patient. Most of us don't want to explain these basic things over and over again. Keep in mind, that some of us (I f. ex. ) are busy with gaining their lifes coz nothing comes for free, eh? - or studying in the evening, after work.

@freanan: That's most prolly been because you haven't fetched all blocks of the Kernel into memory. ;-)

NOw letz finish it :-) Just go ahead, do oyur homework and if there's some problem, ask us.

Stay safe.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:New to OS Dev.

Post by Pype.Clicker »

Im not sure, but when should I set SS / DS or whatever?
Also, What role to SS and DS play?
I'd say you need some book like L'Assembleur Facile. I don't know the pending of that book in other languages, but i guess they exists (If some of you have a good reference - i mean a pocket book covering stuff like "binary arithmetic", "using the stack", "coding a loop in assembly", "how repmovsb works", "BIOS interrupts", etc. , would you mind posting it in the "books" thread ?)
It might seem like trying to hide from the problems of coding your own bootloader, but it is really better to just use grub.
And i think grub can boot a kernel from a fat fs too...
If i might do an advice for an OS dever newbie, it would be "go ahead: write your bootsector and try to load a "hello world" kernel with it. Don't spend more 2 weeks on it. After two weeks, make sure you're ready to do the big jump and go to grub".

See "boot" in the FAQ and http://www.osdev.org/osfaq2/index.php/BabyStep for locally-owned material.
Most of us don't want to explain these basic things over and over again. Keep in mind, that some of us (I f. ex. ) are busy with gaining their lifes coz nothing comes for free, eh? - or studying in the evening, after work.
or even doing both (i guess that's why clicker is progressing so sloowly these last monthes)
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:New to OS Dev.

Post by distantvoices »

@pype: me too. 've taken the plunge finally and am starting to dive into the world of academia. And maths. again maths. *rofl*
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:New to OS Dev.

Post by Brendan »

Hi,
Pype.Clicker wrote:If i might do an advice for an OS dever newbie, it would be "go ahead: write your bootsector and try to load a "hello world" kernel with it. Don't spend more 2 weeks on it. After two weeks, make sure you're ready to do the big jump and go to grub".
I completely agree, but I'd look a little more into the future. Something like:

Go ahead: write your bootsector and try to load a "hello world" kernel with it. Don't spend more 2 weeks on it. After two weeks, make sure you're ready to do the big jump and go to grub". Then, after playing with GRUB and your toy/hobby OS for years you may eventually reach the point where you're ready to start working on a serious OS. If/when you reach this point, work out an OS design based on everything you've learnt, and then you'll probably realise that you need to dump GRUB (and FAT) and go back to writing your own boot loader.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply