flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Accessing C main function? |
Author |
|
vid 14 Mar 2007, 20:38
so bootloader is in FASM. Bootloader should execute main() function of your kernel.
Where is your OS kernel stored? In what format? On what filesystem? |
|||
14 Mar 2007, 20:38 |
|
f0dder 14 Mar 2007, 23:27
Piece of advice: don't call your kernel entry "main". Main is for C programs linked with libc, OS kernels generally don't (and shouldn't, imho) link against libc.
How do you call your entrypoint, though? Grab a copy of the ELF specs |
|||
14 Mar 2007, 23:27 |
|
rhyno_dagreat 15 Mar 2007, 21:37
Right now I'm not using a filesystem on it. I'm moreso focused on getting interrupts going before I worry about the HD. I want to compile everything to a flat binary right now. Now if I need to have a filesystem, I need to learn how to do filesystem programming (and if there are any good resources, please tell me if necessary right now).
Thanks, and my apologies if I make no sense, I have my obnoxious sister behind me. |
|||
15 Mar 2007, 21:37 |
|
f0dder 15 Mar 2007, 23:06
Don't do a flat binary, using a proper file format (PE or ELF) for the kernel has a lot of advantages. And the difference in code for loading a raw kernel or a PE kernel is very small - I posted mine in some other topic.
|
|||
15 Mar 2007, 23:06 |
|
rhyno_dagreat 15 Mar 2007, 23:11
f0dder - For this to happen, I would need a filesystem. Do you know a good filesystem I could use and some docs explaining it?
|
|||
15 Mar 2007, 23:11 |
|
f0dder 15 Mar 2007, 23:17
Nah, you don't necessarily need a filesystem, there's plenty of ways you can load your kernel:
*) etherboot with NBI format kernel - super fast load, and really great if you have a NIC with flash memory. I do (or did, considering how long it is since I worked on my kernel) this when testing with my dedicated testbox with an intel eepro100 card. *) transfer across serial cable - slow. Did this before getting the eepro. *) put the kernel on a (no-filesystem) floppy right after the bootsector and read in directly. *) load your kernel from DOS (and use FAT filesystem or whatever). Feels somewhat "dirty", but means you can focus on writing your kernel, instead of getting it loaded . *) iirc bochs has some "load kernel" hack mainly meant for linux, but which could be used for other stuff as well. |
|||
15 Mar 2007, 23:17 |
|
rhyno_dagreat 15 Mar 2007, 23:19
Cool, thanks.
|
|||
15 Mar 2007, 23:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.