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
1 answer

How to do profiling with QEMU?

I am developing an OS (as a hobby) using QEMU and GDB but I'm now facing some performance issues. Therefore, I would like to know which functions should be optimized. So basically, my needs are mainly to know: In which functions my kernel is…
Maxime Chéramy
  • 17,761
  • 8
  • 54
  • 75
7
votes
4 answers

Purpose of self-IPI on IA-32

What is the purpose of a processor sending an Inter Processor Interrupt to itself on the IA-32 architecture? According to the Intel IA-32 Architecture Software Developer's Manual, Vol. 3, Ch. 10.1: IPIs are used for software self-interrupts,…
jmiller
  • 71
  • 2
7
votes
1 answer

Statically Defined IDT

I'm working on a project that has tight boot time requirements. The targeted architecture is an IA-32 based processor running in 32 bit protected mode. One of the areas identified that can be improved is that the current system dynamically…
jkayca
  • 241
  • 3
  • 5
7
votes
3 answers

Confused with CMPSB instruction

I have been looking at this code and I'm confused about the rep cmpsb line. .LOOP: push cx mov cx, 0x000B ; eleven character name mov si, ImageName ; image name to find …
Hudson Worden
  • 2,263
  • 8
  • 30
  • 45
6
votes
1 answer

Using LLDT and configuring the GDT for it

I'm working on a small OS that will use a separate Local Descriptor Table for each process. I understand that I will need to use the lldt instruction to load a LDT segment from my GDT. I already have my kernel running in protected mode with a…
Alex Nichol
  • 7,512
  • 4
  • 32
  • 30
6
votes
1 answer

Why BIOS need to compare a value in (seemly) randomized address to zero in the second instruction?

I am trying to learn operating system by diving into the low-level details of it. And the course I'm now on is MIT 6.828 Operating System Engineering. The lab asks students to trace into the BIOS for a few instructions. The first three assembly…
Bicheng
  • 687
  • 8
  • 20
6
votes
1 answer

Cannot modify data segment register. When tried General Protection Error is thrown

I have been trying to create an ISR handler following this tutorial by James Molloy but I got stuck. Whenever I throw a software interrupt, general purpose registers and the data segment register is pushed onto the stack with the variables…
6
votes
1 answer

Linking two or more assembly files

I am developing a simple and small 64bit OS. Until now I've used a single file and compile it with NASM: nasm -f bin os.asm -o os.bin Then tested the .bin file with qemu. Now I need to use multiple files so in my os.bin file. I've inserted this…
Mimmo
  • 97
  • 7
6
votes
4 answers

How do I disable non maskable interrupts programmatically?

I've read that in order to temporarily turn off paging according to Intel's system programming guide (volume 3 chapter 9.9) I should disable interrupts before doing anything else. I can easily disable maskable interrupts with cli but all the manual…
6
votes
1 answer

How to map the section to the segment from an ELF output file?

Well I have written a bootloader in assembly and trying to load a C kernel from it. This is the bootloader: bits 16 xor ax,ax jmp 0x0000:boot extern kernel_main global boot boot: mov ah, 0x02 ; load second stage to memory mov…
rsonx
  • 436
  • 7
  • 16
6
votes
0 answers

Linking 32- and 64-bit code together into a single binary

In a comment to this question, Unexpected behaviour in simple pointer arithmetics in kernel space C code, Michael Petch wrote, "The 64-bit ELF format supports 32-bit code sections." I have a working program that includes both 32- and 64-bit code and…
prl
  • 11,716
  • 2
  • 13
  • 31
6
votes
2 answers

Assembly executing a long jump with an offset with different syntax

I am writing a GDT for a Kernel and all is going well, I'm following this tutorial. http://www.osdever.net/bkerndev/Docs/gdt.htm When link the C code to the assembly code he uses this piece of code. ; This will set up our new segment registers. We…
user5930979
6
votes
1 answer

How to load IDT?

I'm working on writing own little os. I already done booting, entering protected mode, some text printing and serial communication with qemu. I've been trying to add interrupts for over two days. I was looking everywhere including other systems…
Hexagonale
  • 150
  • 9
6
votes
1 answer

x86 ASM: DD Being Used as an "Instruction"?

In the following x86 assembly code: dd 0x1BADB002 dd 0x00 dd - (0x1BADB002+0x00) The values don't seem to be assigned to any variables. So what does this snippet of code do? I've heard something about it being stored in memory, but where exactly?
user5718553
6
votes
2 answers

Switching to a higher resolution

Recently, I started developing an operating system in NASM and C. I have already made a boot loader, kernel, filesystem, etc. So far I used the VGA text mode directly in order to write to the address 0x000B8000. So, I decided to switch to video mode…
user4180960