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

How to make the kernel for my bootloader?

I'm trying to make my own custom OS and I need some help with my code. This is my bootloader.asm: [ORG 0x7c00] start: cli xor ax, ax mov ds, ax mov ss, ax mov es, ax mov [BOOT_DRIVE], dl mov bp, 0x8000 mov sp, bp …
11
votes
5 answers

How to load a kernel from disk with BIOS int 13h in NASM assembly?

I've been stuck with this for weeks now and have no idea where I'm going wrong because NASM hasn't given me any errors. The code is pretty self explanatory because of the comments. this is the code that is loaded from the BIOS …
user188025
9
votes
1 answer

Should using MOV instruction to set SS to 0x0000 cause fault #GP(0) in 64-bit mode?

This question is inspired by a Reddit question in r/osdev except that this question focuses on the SS register. One may say RTFM (ISA entry for MOV), but when this question comes up it can get varying answers even among OS developers. Question:…
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
9
votes
1 answer

PS/2 keyboard won't send keypress interrupts, but does respond to commands

I'm fairly new to OS development and I recently started a hobby project of creating a simple-as-possible text-only operating system. It's written in C with some help from assembly and uses GRUB for booting, and I've been testing it in VirtualBox and…
Adam
  • 131
  • 5
9
votes
11 answers

What is a good barebones linux distro for beginner kernel development?

In my Operating Systems class we are looking to modify a Linux kernel with some simple system calls of our own in C. What would be a good distro suited for this purpose? We don't need any frills, no GUI, a vanilla kernel, etc. The more basic the…
mmcdole
  • 91,488
  • 60
  • 186
  • 222
9
votes
2 answers

How to solve qemu gdb debug error: Remote 'g' packet reply is too long?

I'm currently getting into bootloaders and kernel development (very much beginning) I'm following a combination of https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf and the code found…
Jaap Wijnen
  • 417
  • 2
  • 6
  • 12
9
votes
3 answers

How does SMP multithreading share memory and interrupts?

I'm doing some work on the input buffers for my kernel, and I had some questions. On Dual Core machines, I know that more than one "process" can be running simultaneously. What I don't know is how the OS and the individual programs work to protect…
Blank
  • 7,088
  • 12
  • 49
  • 69
9
votes
1 answer

Keyboard IRQ within an x86 kernel

I'm trying to program a very simple kernel for learning purposes. After reading a bunch of articles about the PIC and IRQs in the x86 architecture, I've figured out that IRQ1 is the keyboard handler. I'm using the following code to print the keys…
Delights
  • 349
  • 4
  • 10
9
votes
4 answers

How do I write a bin file (512 bytes) to the first sector (sector 0) of a floppy disk?

How do I write a .bin file to be in the first sector of a floppy disk/virtual floppy disk/floppy image? I'm trying to boot a simple 512-byte bootloader. The size on everywhere says "512 bytes" so I should be good already. Additional Information: The…
Star OS
  • 119
  • 1
  • 1
  • 15
9
votes
2 answers

Setting up IRQ mapping

I'm following several tutorials and references trying to get my kernel set up. I've come across some unfamiliar code in a tutorial that isn't explaining it at all. It's code that I'm told maps the 16 IRQs (0-15) to ISR locations 32-47: void…
Blank
  • 7,088
  • 12
  • 49
  • 69
9
votes
2 answers

What happens with a processor when it tries to access a nonexistent physical address?

Imagine a 32-bit x86 computer with less than 3 gigabytes of memory with CPU set up with disabled paging and flat segment descriptors (0x0 as base, 0xffffffff as an effective limit for both data and code). What happens when an instruction in ring0…
gfv
  • 784
  • 7
  • 12
9
votes
5 answers

The stack size used in kernel development

I'm developing an operating system and rather than programming the kernel, I'm designing the kernel. This operating system is targeted at the x86 architecture and my target is for modern computers. The estimated number of required RAM is 256Mb or…
Blank
  • 7,088
  • 12
  • 49
  • 69
9
votes
7 answers

Other than malloc/free does a program need the OS to provide anything else?

I'm working on designing the kernel (which I'm going to actually call the "core" just to be different, but its basically the same) for an OS I'm working on. The specifics of the OS itself are irrelevant if I can't get multi-tasking, memory…
Blank
  • 7,088
  • 12
  • 49
  • 69
9
votes
1 answer

Why Enable/Disable A20 Line

I have a question about the A20 gate. I read an article about it saying that the mechanism exists to solve problems with address "wraparound" that appeared when newer CPUs got a 32-bit address bus instead of the older 20-bit bus. It would seem to me…
smainoo
  • 139
  • 5
8
votes
3 answers

Simple in memory file system

Can anybody point me to a simple (can't stress this enough) implementation of an in memory file system? If I can create a file and do a simple cat file.txt it's more than enough. I would like to use it as part of my toy OS.
user173973
1 2
3
72 73