Page 1 of 1

os

Posted: Sun Feb 14, 2016 3:06 pm
by ammar
i am executed boodloder from the first sector 512 in fahs how load kernel
and seek the secoud soctoer pleas help me and bliud small kernel
use fat32 ?


Report private message

Re: os

Posted: Sun Feb 14, 2016 3:34 pm
by onlyonemac
Usually you load the kernel using the BIOS functions for reading from a disk. You determine the location and size of the kernel on the disk using your preferred method (FAT filesystem is a common choice, but you can also just put the kernel in a pre-determined location especially for testing) and then use the BIOS functions to read the kernel into memory. (The BIOS functions are also used to read filesystem structures if you are using a filesystem such as FAT.) Once you've loaded the kernel, you jump to the memory address where the kernel is loaded to execute it.

You should read up on the BIOS interrupts. You'll also want to read up on Real Mode, Protected Mode, Long Mode, and the differences between them, Paging and Segmentation, interrupts, and many other things before you can write a kernel.

Here's a tip: if you want to get useful help here, try to break your questions down into smaller, easier-to-answer questions. (This applies when writing the OS as well: break the large tasks down into smaller, manageable tasks.) People also appreciate it if you try to do some research before asking a question, and don't come asking general questions like "how to load kernel"; a more appropriate question would be "I've tried to load a kernel using BIOS functions which seems to be the best way that I can find, but it's not working. Am I doing this correctly?" and include some of your source code with the question. Try to also use better spelling and grammar - while I appreciate that not everyone speaks English as a first language and thus doesn't always use correct grammar, your spelling seems rather bad and using an English spellchecker will go a long way to improving the responses that you get.

Re: os

Posted: Sun Feb 14, 2016 4:43 pm
by SpyderTL
You don't need to write your own boot loader. You can use one of the free ones, like GRUB, which will work on pretty much any storage device (floppy, hard drive, cd-rom, etc.)

But, if you want to write your own, check out this wiki article: Rolling Your Own Bootloader