where do i start?

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.
Locked
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

where do i start?

Post by earlz »

I have recently decided that my crappy real mode os is going to protected mode; of course most of the code relied on segmentation, so i scrapped most of the code, now i just need some help figuring out where to start over from, i already got basic screen printing(printf,printc) and have made a pokeb and peekb function

but now what?

edit:
btw im new to protected mode but not necessarily assmebly or real mode

edit2:
im an idiot i forgot, i dont even need poke or peek, a simple: byte *ptr;ptr=adress;data=*ptr
im an idiot
Last edited by earlz on Fri Sep 09, 2005 11:00 pm, edited 2 times in total.
stosby
Posts: 1
Joined: Tue Oct 12, 2021 10:27 pm

Re: where do i start?

Post by stosby »

You might want to get interrupts (See here: https://wiki.osdev.org/Interrupt_Descriptor_Table) and an interrupt controller (see: https://wiki.osdev.org/PIC) working. You'll probably need to set up a clock (see: https://wiki.osdev.org/RTC) and a timer (see: https://wiki.osdev.org/Programmable_Interval_Timer). Then you might want write up some drivers for NICs or other devices. Or add support for ACPI or USB. If you want to support AMD64, you should enter long mode. See https://wiki.osdev.org/What_Order_Shoul ... ings_In%3F to get a general direction to start working on and https://wiki.osdev.org/Going_Further_on_x86 for a more specific roadmap. Hope this is what you were looking for.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: where do i start?

Post by nullplan »

I would say, the very first thing you need to get working is memory management. Possibly with a temporary IDT that only handles exceptions and just always panics. Once memory works, move on to initializing the CPU (as in, GDT, IDT, TSS, all the little MSRs, maybe paging), and then tackle interrupts and discover the hardware. That last one mainly means to start reading ACPI tables to find out what hardware is in the system, then move on to enumerating the PCI bus(ses) you find in the ACPI tables, then probably USB. This is also when you will need to decide on how to work with drivers, how to expose devices to the applications, and where you want to go ultimately. I don't know any OS that can make do without hardware discovery, but what to do with the discovered hardware can be complicated.
Carpe diem!
klange
Member
Member
Posts: 679
Joined: Wed Mar 30, 2011 12:31 am
Libera.chat IRC: klange
Discord: klange

Re: where do i start?

Post by klange »

This thread is 16 years old. Please do not continue old threads without good reason.
Locked