os

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.
Post Reply
ammar
Posts: 14
Joined: Thu Feb 11, 2016 10:55 am
Libera.chat IRC: ammars6

os

Post 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
Last edited by ammar on Wed Feb 17, 2016 3:19 pm, edited 1 time in total.
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: os

Post 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.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: os

Post 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
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Post Reply