Operating Systems Checklist

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Operating Systems Checklist

Post by Mikemk »

I think there should be a checklist of things available to the general public about scrambling eggs (joking, about os development :wink: ).

These are what I know of:
  1. Bootloader
    1. Master Boot Record
    2. 0xAA55
    3. Enter Protected Mode
  2. ...
Feel free to add to it.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Operating Systems Checklist

Post by gerryg400 »

If it's a list of what's involved in writing an OS, it would be a very long list. And a list might not be the best way to present it.

Perhaps you're suggesting a list of things to do when booting a PC ? That could be managed as a list.
If a trainstation is where trains stop, what is a workstation ?
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Operating Systems Checklist

Post by Mikemk »

I'm suggesting a list with the things common among all OSs
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Operating Systems Checklist

Post by gerryg400 »

m12 wrote:I'm suggesting a list with the things common among all OSs
But those things are only a *small* part of the *early* boot sequence of an OS running on a *specific* machine (perhaps PC) with a *particular* type of firmware (BIOS). They actually have nothing at all to do with general OS development.

I'm not saying that there's anything wrong with making a list like you're suggesting...
If a trainstation is where trains stop, what is a workstation ?
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Operating Systems Checklist

Post by Mikemk »

It would still be quite helpful to new developers (like me)
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Operating Systems Checklist

Post by bluemoon »

Follow the tutorials, at some point you make departure from tutorials and you know what's next.
And no, MBR is not part of an OS, it's a supporting tool. Your OS should boot with any pre-installed MBR, if any.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Operating Systems Checklist

Post by Mikemk »

The purpose of this topic was to create a checklist, for everyone, not to be told to "follow the tutorials"
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Operating Systems Checklist

Post by bluemoon »

The list will be either over-simplify like boot->init->load module->open a shell; or too complex to be listed. Seriously, you will know what's next if os developer is ready for it; otherwise, such a list would consist of difficult concepts that provide little help to starter.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Operating Systems Checklist

Post by iansjack »

That list rules out Linux for starters, which relies on an external boot loader such as Grub. Many hobby OSs also use Grub, so those items don't apply. Bluemoon is correct to say that you are confusing boot loader with OS. Each OS, each processor, is different so a generic checklist is going to be difficult to draw up. None of what you list applies to an embedded OS on an ARM processor, for example.

A list would be so general to be useless. Something like:

1. Initialize processor and other hardware.
2. Manage memory.
3. Manage I/O.
4. Manage persistant storage (if any).
5. Manage processes (if any).
6. ...

Accurate, but not really helpful.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Operating Systems Checklist

Post by Combuster »

m12 wrote:The purpose of this topic was to create a checklist, for everyone, not to be told to "follow the tutorials"
The purpose of this thread is to tell you that there is no universal checklist that's actually meaningful. Even iansjack's "generic" list becomes wobbly when you throw good old DOS (don't manage, who cares anyway?) at it, and there are a few hobby OSes out there with a similar mindset.

Basically, the best list I can come up with is:
1: Design
2: Implement
3: Go to 1 (because nobody is perfect and you must have done something wrong somewhere. :mrgreen: )

Your next best bet is What_order_should_I_make_things_in
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
AndrewAPrice
Member
Member
Posts: 2300
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: Operating Systems Checklist

Post by AndrewAPrice »

A OS checklist works upon the assumption that everyone will do things the same way. A single tasking OS may not want to do memory protection (I sure don't do paging or deal with virtual address spaces in my kernel).

What are you looking for? A checklist on what to do to enter protected/long mode? A checklist on how to make another POSIX clone?
My OS is Perception.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Operating Systems Checklist

Post by bluemoon »

If you're looking what people do in their init sequence, just for your reference, in my OS:

Stage 1
  • Set CPU Flags and registers to known state
  • Setup mini stack
  • Export file reading functions for subsequent stages
  • Load and pass control to stage 2
Stage 2
  • Set CPU Flags and registers to known state again
  • Re-setup mini stack
  • Enable A20
  • Get memory map
  • Detect CPU
  • For 32-bit CPU, load kernel32.bin and initrd32.bin into high memory, start kernel in 32-bit protected mode
  • For 64-bit CPU, load kernel64.bin and initrd64.bin into high memory, start kernel in long mode with 2MB identity mapped paging
32-bit kernel
  • Set CPU Flags and registers to known state again
  • Clear BSS
  • Paging & Higher-half
  • Setup GDT
  • Kernel mini stack
  • Setup TSS
  • Setup IDT(INT80 & exceptions)
  • Setup MMU(mmap and unmap now usable)
  • Setup PIC/APIC, IRQ handlers and Timer
  • Initial scheduler
  • Enable interrupts
  • Load built-in drivers(ramdisk, initrd file system)
  • HAL - detect hardware and setup more drivers from initrd
  • Some testing code like running some test app in userland
64-bit kernel
  • Set CPU Flags and registers to known state again
  • Clear BSS
  • Paging & Higher-half
  • Setup GDT
  • Kernel mini stack
  • Setup TSS
  • Setup syscall
  • Setup IDT(exceptions)
  • Setup MMU(mmap and unmap now usable)
  • Setup PIC/APIC, IRQ handlers and Timer
  • Initial scheduler
  • Enable interrupts
  • Load built-in drivers(ramdisk, initrd file system)
  • HAL - detect hardware and setup more drivers from initrd
  • Some testing code like running some test app in userland
You may notice my 32-bit & 64-bit kernel shares very similar workflow, and in fact they share most of the code except bootstrap, mmu, syscall entrance, program loader and context switching code.
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Re: Operating Systems Checklist

Post by LindusSystem »

You told initial scheduler before enabling interrupts, what will you use as timer then?
NO INTERRUPTS(SO no IRQ 0 and 8)
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Operating Systems Checklist

Post by bluemoon »

I mean initialize scheduler, that was a typo.
there is some data structure to be initialized like setting "current process", etc.
Once it is initialized the timer can trigger scheduling.
Post Reply