Questions tagged [osdev]

Operating System development: kernel, shell, networking, cross-compiling, etc.

An operating system is the base software that runs atop computers. It has at least two important roles:

  • it manages access to the underlying hardware, regulating competing access to the same resources from multiple programs;
  • it presents an extended machine for programs that is easy to understand and use.

Operating system development comprises several topics, like:

  • kernel;
  • supporting operating system utilities (e.g. the shell, networking, etc.);
  • cross compiling.

Resources

This community wiki contains links to several interesting resources and courses to get started on operating system development:

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

1093 questions
7
votes
5 answers

C without stdio, what is possible?

I've been interested in programming an operating system for some time. Delving through a few different sites, I've come across an interesting concept (to paraphrase): if you start writing your bootloader with #include, you've already made a fatal…
Matticus
  • 155
  • 2
  • 10
7
votes
1 answer

Higher half kernel initialization

When initializing my kernel, I have a few things that need to happen: 1) paging needs to be enabled, 2) the physical memory manager needs to parse the memory map from grub, and 3) assorted startup code needs to access data that needs to stay there…
rpjohnst
  • 1,612
  • 14
  • 21
7
votes
1 answer

Solution needed for building a static IDT and GDT at assemble/compile/link time

This question is inspired by a problem many have encountered over the years, especially in x86 operating system development. Recently a related NASM question was bumped up by an edit. In that case the person was using NASM and was getting the…
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
7
votes
2 answers

What happens to a Startup IPI sent to an Active AP that is not in a Wait-for-SIPI state

In a previous Stackoverflow answer Margaret Bloom says: Waking the APs This is achieved by inssuing a INIT-SIPI-SIPI (ISS) sequence to the all the APs. The BSP that will send the ISS sequence using as destination the shorthand All excluding self,…
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
7
votes
1 answer

Understanding Inline assembly in a pre-processor macro vs Inline assembly in a function

GGC's inline assembly can be difficult to implement properly and easy to get wrong1. From a higher level perspective inline assembly has some rules that have to be considered outside of what instructions an inline assembly statement may emit. The…
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
7
votes
1 answer

How to write a simple soundblaster 16 driver using direct write mode for a hobby OS?

I am developing a 32 bit, protected mode hobby operating system. At the moment, I am looking to add simple sound support. To do this, I'm looking to use the sound blaster 16 and use the direct mode to write to the DAC (I want to avoid DMA at all…
7
votes
6 answers

Do I have to pop the error code pushed to stack by certain exceptions before returning from the interrupt handler?

I have loaded an idt table with 256 entries, all pointing to similar handlers: for exceptions 8 and 10-14, push the exception number (these exceptions push an error code automatically) for the others, push a "dummy" error code and the exception…
Joao da Silva
  • 7,353
  • 2
  • 28
  • 24
7
votes
1 answer

Is it possible to map a process into memory without mapping the kernel?

The OSDev wiki says that: It is traditional and generally good to have your kernel mapped in every user process Why is that though? Can't the process be mapped to memory solely? What are the advantages of mapping the kernel and wouldn't that be a…
Trey
  • 474
  • 2
  • 9
  • 32
7
votes
3 answers

How do I programmatically create a bootable CD?

I'm using a barebones tutorial as the basis for an OS I'm working on, and it seems to be an older tutorial: it has be compiling the kernel down to a floppy image, and then loading it with GRUB. Basically, I still want to use GRUB, but I'd like to…
Blank
  • 7,088
  • 12
  • 49
  • 69
7
votes
1 answer

Enable the boot loader to load the second sector of a USB

I am learning the assembly language. I wrote a simple bootloader. After testing it out, it didn't work. Here is my code: [bits 16] [org 0x7c00] jmp start data: wolf_wel_msg db 'Welcome to Bootloader!!!',0x0D,0x0A,0 wolf_kernel_load db 'Loading…
7
votes
3 answers

Should I make my own OS kernel ELF or raw binary?

I have started my journey through OS development. People usually shout that using raw binary instead of ELF (or other structured format) is a common mistake for applications in a custom OS. I can second that because of additional benefits ELF…
Igor Zhirkov
  • 303
  • 2
  • 8
7
votes
1 answer

Creating a simple multiboot kernel loaded with grub2

I'm trying to follow the instructions here to build a simple OS kernel: http://mikeos.sourceforge.net/write-your-own-os.html Except, instead of booting from a floppy, I want to create a grub-based ISO image and boot a multiboot CD in the emulator. …
BadZen
  • 4,083
  • 2
  • 25
  • 48
7
votes
1 answer

Implementing basic operations for built-in types without using libcore

When I write a simple code for bare metal without using libcore I get the following error: error: binary operation != cannot be applied to type u32 [E0369] Straight forward implementation confronts the chicken-and-egg problem: #![crate_type =…
ababo
  • 1,490
  • 1
  • 10
  • 24
7
votes
1 answer

Memory map shows more RAM than physically available

I am working on a small x86 kernel. I am accessing and attempting to read the memory map that GRUB provides in the multiboot header. I have an Intel i3 cpu and 4 GiB of RAM. While running on this machine, I am reading the following memory map: …
Joel
  • 4,732
  • 9
  • 39
  • 54
7
votes
4 answers

Mixing 32 bit and 16 bit code with nasm

This is a low-level systems question. I need to mix 32 bit and 16 bit code because I'm trying to return to real-mode from protected mode. As a bit of background information, my code is doing this just after GRUB boots so I don't have any pesky…
terry