How to load second stage boot loader from first stage?

On x86 you would do the following (simplified): Have the bootloader load the n-th sector of the disk/floppy (wherever you’re booting from) into memory and execute it (i.e. load segment/offset and do retf). A better alternative is to search the filesystem for a certain filename (e.g. KERNEL.BIN) — but you’d need to know the file … Read more

Historical reason behind different line ending at different platforms

DOS inherited CR-LF line endings (what you’re calling \r\n, just making the ascii characters explicit) from CP/M. CP/M inherited it from the various DEC operating systems which influenced CP/M designer Gary Kildall. CR-LF was used so that the teletype machines would return the print head to the left margin (CR = carriage return), and then … Read more

What are some resources for getting started in operating system development? [closed]

There are a lot of links after this brief overview of what is involved in writing an OS for the X86 platform. The link that appears to be most promising (www.nondot.org/sabre/os/articles) is no longer available, so you’ll need to poke through the Archive.org version to read it. At the end of the day the bootloader … Read more

Difference between binary semaphore and mutex

They are NOT the same thing. They are used for different purposes! While both types of semaphores have a full/empty state and use the same API, their usage is very different. Mutual Exclusion Semaphores Mutual Exclusion semaphores are used to protect shared resources (data structure, file, etc..). A Mutex semaphore is “owned” by the task … Read more