sp3tsnaz
sp3tsnaz

Reputation: 506

linux kernel booting from my bootloader

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 .

Upvotes: 1

Views: 851

Answers (2)

shodanex
shodanex

Reputation: 15406

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

Upvotes: 3

susmits
susmits

Reputation: 2238

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

Upvotes: 0

Related Questions