OS development question

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
ankitbehera2670
Posts: 8
Joined: Wed Mar 08, 2017 1:58 am

Os development help

Post by ankitbehera2670 »

hi I am following the meaty os tutorial. I am currently using grub as the bootloader but I want to use a custom bootloader for my os. As i am new to this I have no idea about how to do that. Please help me!
ankitbehera2670
Posts: 8
Joined: Wed Mar 08, 2017 1:58 am

OS development question

Post by ankitbehera2670 »

HI I am following the meaty os tutorial but when i run the os in virtualbox, It displays my message but also displays letter "o" at the end of the line. Is it some type of problem??
User avatar
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Re: OS development question

Post by obiwac »

This might not be the answer to your problem, but check that you have not mistaken any zeros with the letter o. If you wanted to insert a null character in a string, you would do "some text\0" but you might have done "some text\o".
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: OS development question

Post by iansjack »

It sounds to me as if the printer function is writing the graphic of the "\n" to the screen rather than processing it correctly.
azblue
Member
Member
Posts: 147
Joined: Sat Feb 27, 2010 8:55 pm

Re: Os development help

Post by azblue »

ankitbehera2670 wrote:hi I am following the meaty os tutorial. I am currently using grub as the bootloader but I want to use a custom bootloader for my os. As i am new to this I have no idea about how to do that. Please help me!
Make sure you code your bootloader for 16 bit real mode (you'd be surprised how many people think it'll run in 32 bit protected mode just because they wrote "[bits32]"!) You'll probably want to set all your segments to 0 and start your code with "org 7c00h".
You'll want to familiarize yourself with Ralf Brown: http://www.ctyme.com/rbrown.htm
The BIOS will give you your drive number in the dl register; use that when calling the BIOS disk read function (int 13h function 2 or 42h).
Load sectors for whatever runs next (2nd stage bootloader, kernel startup program, kernel itself).

You probably want to be in protected mode before loading your kernel: remap the PIC, setup a GDT, set the PM bit in CR0, and far jump to your PM code.
ankitbehera2670
Posts: 8
Joined: Wed Mar 08, 2017 1:58 am

Re: OS development help

Post by ankitbehera2670 »

Thanks for the help.
Post Reply