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
16
votes
3 answers

Protected Mode Keyboard Access on x86 Assembly

I'm working on keyboard input for a very basic kernel that I'm developing and I'm completely stuck. I can't seem to find any information online that can show me the information I need to know. My kernel is running in protected mode right now, so I…
Blank
  • 7,088
  • 12
  • 49
  • 69
14
votes
3 answers

Is there any small kernel good enough for learning osdev?

I would like to learn more about osdev. So I thought about learning from other small kernels to get better at osdev. Is there any good kernel for learning osdev? Of course it needs to be GPL so I can have access to source code and have the freedom…
Victor
  • 1,655
  • 9
  • 26
  • 38
14
votes
3 answers

Changing bios code/flashing the bios

I've spent a lot of time developing an operating system and working on my low level boot loader. But now I want to take some time off my operating system while not leaving the low-level environment and doing something involving security. So I chose…
Rick
  • 151
  • 1
  • 4
14
votes
2 answers

Switching to User-mode using iret

I am writing a small OS that will execute some code in user mode (privilege level 3). From that user level code, I want to call an interrupt back to the OS that prints a message. Right now I don't really care how my interrupt handler takes…
Alex Nichol
  • 7,512
  • 4
  • 32
  • 30
14
votes
1 answer

How can I call a raw address from Rust?

I am writing an OS in Rust and need to directly call into a virtual address that I'm calculating (of type u32). I expected this to be relatively simple: let code = virtual_address as (extern "C" fn ()); (code)(); However, this complains that the…
Isaac Woods
  • 1,114
  • 1
  • 17
  • 28
14
votes
1 answer

Write::write_fmt causes page fault on a bare metal

My experimental code crashes when running on bare x86_64-metal (page fault when IDT is not yet set), but works perfectly on aarch64. By careful tracing I figured out that the cause of this page fault consists of corrupted address (much higher than…
ababo
  • 1,490
  • 1
  • 10
  • 24
14
votes
1 answer

Cache-as-Ram (no fill mode) Executable Code

I have read about cache-as-ram mode (no-fill mode) numerous times and am wondering whether number one, can executable code be written and jumped to and if so is the executable code restricted to half of the level one cache (since the cache is really…
n00ax
  • 307
  • 3
  • 7
13
votes
3 answers

Return value of a C function to ASM

I'm trying to call a function from within ASM. I know how to call it, but i'm having trouble finding how to get the return value of this function. An example follows: C code: int dummy() { return 5; } (N)ASM code: dummyFunction: …
Juan Pablo
  • 593
  • 1
  • 6
  • 12
13
votes
1 answer

(Writing kernel) How do I modify the interrupt descriptor table?

I am writing a small kernel just to poke around the low level stuff a bit. Right now, it boots in Virtual Box and I can display text to the screen, allocate some memory, and other really basic things. It's written in C++ and a little asm. One of…
rovaughn
  • 1,213
  • 15
  • 24
12
votes
2 answers

Creating a bootable ISO image with custom bootloader

I am trying to convert a bootloader I wrote in Assembly Language to an ISO image file. The following is the code from MikeOS bootloader. Here is my bootloader code: BITS 16 start: mov ax, 07C0h ; Set up 4K stack space after this…
Mahmoud Abdel-Rahman
  • 497
  • 2
  • 10
  • 27
12
votes
2 answers

Enabling GRUB to automatically boot from the kernel

I am developing a kernel for an operating system. In order to execute it, I've decided to use GRUB. Currently, I have a script attached to GRUB's stage1, stage2, a pad file and the kernel itself together which makes it bootable. The only problem…
Cristián Romo
  • 9,814
  • 12
  • 50
  • 50
12
votes
2 answers

Triple fault on stack in C code

I am writing a toy kernel for learning purposes, and I am having a bit of trouble with it. I have made a simple bootloader that loads a segment from a floppy disk (which is written in 32 bit code), then the bootloader enables the A20 gate and turns…
magpie
  • 121
  • 4
11
votes
1 answer

GCC code that seems to break inline assembly rules but an expert believes otherwise

I was engaged with an expert who allegedly has vastly superior coding skills than myself who understands inline assembly far better than I ever could. One of the claims is that as long as an operand appears as an input constraint, you don't need to…
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
11
votes
1 answer

undefined reference to _GLOBAL_OFFSET_TABLE_ (only when generating binaries)

this is the problem: When I link my scripts in C, using ld, when I generate elf32-i386 files as output format in ld, putting it as OUTPUT_FORMAT() in the ld script, I dont have any error, but if I try to put in this last OUTPUT_FORMAT() "binary" or…
Rottenheimer2
  • 425
  • 1
  • 5
  • 13
11
votes
1 answer

Disk Read Error while loading sectors into memory

I tried to develop a bootloader using this, but when it is run it shows: disk read error! If I ignore it, in a later part, it shows me wrong memory mapping. I also followed some other sources too but in vain. It feels like I'm just copying what…
Palvit Garg
  • 137
  • 2
  • 9
1
2
3
72 73