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
8
votes
2 answers

Problem switching to v8086 mode from 32-bit protected mode by setting EFLAGS.VM to 1

I'm in 32-bit protected mode running at current privilege level (CPL=0). I'm trying to enter v8086 mode by setting EFLAGS.VM (Bit 17) flag to 1 (and IOPL to 0) and doing a FAR JMP to my 16-bit real mode code. I get the current flags using PUSHF; set…
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
8
votes
1 answer

BIOS and Address 0x07C00

from Wikipedia On an IBM PC compatible machine, the BIOS selects a boot device, then copies the first sector from the device (which may be a MBR, VBR or any executable code), into physical memory at memory address 0x7C00 I'm reading about the…
kara
  • 87
  • 6
8
votes
1 answer

How do you explain gcc's inline assembly constraints for the IN, OUT instructions of i386?

As far as I can tell, the constraints used in gcc inline assembly tell gcc where input and output variables must go (or must be) in order to generate valid assembly. As the Fine Manual says, "constraints on the placement of the operand". Here's a…
Robert B
  • 3,195
  • 2
  • 16
  • 13
8
votes
1 answer

GCC - Label address return current EIP rather than real label address

In an attempt to write an OS, I need to get the address of the current function's end (right before epilogue) for task switching. Concretely my problem is to get an EIP to assign to my newly created task (process) inside the copied stack. I have…
Aerath
  • 83
  • 3
  • 6
8
votes
1 answer

The realisticity of writing a full operating system as an UEFI application

Technically UEFI provides a lot of functionality which is part of the groundwork of an operating system, such as a file system. In a way, it is a shame that everything gets discarded and reimplemented by the operating system in the process of…
Thomas F.
  • 381
  • 2
  • 8
8
votes
2 answers

understanding nasm assembly for outputting characters in teletype mode

I am reading this wonderful skript on operating system programming http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf On Page 12 there is a simple bootloader. If I understand correclty, the code shown is what you must write in…
user3813234
  • 1,580
  • 1
  • 29
  • 44
8
votes
1 answer

GCC Inline Assembly 'Nd' constraint

I'm developing a small toy kernel in C. I'm at the point where I need to get user input from the keyboard. So far, I have implemented inb using the following code: static inline uint8_t inb(uint16_t port) { uint8_t ret; asm volatile("inb…
Michael Morrow
  • 403
  • 2
  • 16
8
votes
2 answers

BIOS Interrupts in protected mode

I'm working on an operating system project, using isolinux (syslinux 4.5) as bootloader, loading my kernel with multiboot header organised at 0x200000. As I know the kernel is already in 32-bit protected mode. My question: Is there any easier way to…
amaneureka
  • 1,150
  • 11
  • 26
8
votes
2 answers

Why test port 0x64 in a bootloader before switching into protected mode?

In my MIT OS course (686) I have found some code that I don't understand. I'm trying to understand the instruction inb $0x64, %al in boot/boot.S. My understanding is that it's reading one byte from data port 0x64 into AL, What is port 0x64? Which…
Mike
  • 1,841
  • 2
  • 18
  • 34
8
votes
1 answer

OS Development - booting from floppy drive using qemu

I have been reading BrokenThorn's OS development tutorial and am at the part of creating and loading the second stage bootloader. The tutorial is for Windows, but I am doing this in Linux(Ubuntu 13.04). This is what I have done: Created file…
Cygnus
  • 3,222
  • 9
  • 35
  • 65
8
votes
1 answer

Identifying faulting address on General Protection Fault (x86)

I am trying to write a ISR for the General Protection Fault (GP#13) on x86. I am unable to figure out from the INTEL docs as to how I can find out the faulting address causing the exception. I know that for Page fault exceptions (GP#14) the cr2…
rss
  • 83
  • 1
  • 3
7
votes
3 answers

Where do memory mapped I/O addreses come from?

I am messing around with some hobbyist OS development, and I am a little confused on memory mapped I/O addresses. I understand the whole memory mapped I/O concept, but I am trying to figure out how developers get the addresses to manipulate…
QAH
  • 4,200
  • 13
  • 44
  • 52
7
votes
2 answers

Developing a GUI environment in home-made OS

I have made a desktop os with a kernel in c that prints "hello world". I am trying to make a GUI (custom window manager, buttons) for my os in c but I am having trouble. I looked at one…
Coder404
  • 742
  • 2
  • 7
  • 21
7
votes
1 answer

Is the address checked by the memory alignment check mechanism a effective address, a linear address or a physical address?

I am studying the issue of alignment check. But I don't know whether the processor is checking on effective addresses, linear addresses or physical addresses, or all checks. For example, the effective address of a data has been aligned, but the…
7
votes
1 answer

How do I build a kernel image using Visual Studio?

I'd like to build an embedded kernel for an x86 machine using Visual C++. I have some C and assembly code files to compile and I'd like to link them all together in a way that is compatible with a Multiboot bootloader like GRUB.
Frank Miller
  • 499
  • 1
  • 7
  • 19