views:

84

answers:

2

hi , i wish to load linux using my own bootloader .. preliminary research and google told me that i ll have to use start_kerne() function .. i want to ask how can i call start_kernel() from assembly .. i have already formatted my usb into ext3 and pasted the compiled kernel there .. now how can i start the linux kernel ? any help is welcome // Thankyou in advance

Mohsin .

A: 

The loader that comes with Grub 2 could be a good starting reference

susmits
all theory .. can someone please post an example ?
sp3tsnaz
+1  A: 

Are you sure you need to write your own bootloader ?
You don't call start_kernel. You don't call any function by the way. What you need is to read the kernel image into memory, put some information like the commandline into memory, setup some register and then jump to the entrypoint of the kernel.
Each architecture (x86, ARM etc ...) can have different booting requirement.

If you want to have a deeper understanding, may be you can have a look at u-boot source, for example lib_386/zImage.c

shodanex
all theory .. can someone please post an example ?
sp3tsnaz
Well, I gave the link to an example code, perhaps you could try to read it. Afer all, you want to write your own bootloader, this means you have to work
shodanex