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
0
votes
0 answers

Linker moves section to where it should not

I have this linker script for my elf executable: ENTRY(_start) SECTIONS { . = 0x500; .mboot BLOCK(4K) : ALIGN(4K) { *(.mboot) } . = 0x7E00; .ap_stack BLOCK(48K) : ALIGN(4K) { *(.ap_stack) } …
Enerccio
  • 257
  • 1
  • 10
  • 23
0
votes
1 answer

Writing an OS; asm keyword troubles

asm("lidt (%0)" : : "p"(&idtr)); The above statement will be used to define an IDTR in my IA-32 operating system. For some reason though, the compiler chokes on it: kernel/kernel.c:52:2: error: invalid 'asm': invalid expression as operand …
the_rover
  • 25
  • 4
0
votes
1 answer

How to handle 15th entry in Interrupt Descriptor Table

EDIT: For the source code, you can check my repo on Github: https://github.com/tuhdo/os-study. I mapped the IRQs on 2 PICs (x86) to entry 32th and onward in IDT. To test out the PIC interrupts, I put the first 31 routines to the same function. The…
Tu Do
  • 339
  • 2
  • 11
0
votes
1 answer

Assembly INT 0x13: Not getting an error when trying to read from disk

Whenever I run this in QEMU, I don't seem to get an error, but the message isn't printed on the screen, so I'm not sure what's really happening that I can't see. Here is my code: [org 0x7c00] mov bp, 0x8000 mov sp, bp mov si, name call…
0
votes
3 answers

How do you properly implement turning an int into a string?

I am writing a bit of an operating system, and I require the ability to print the addition of a variable. I have a working atoi function and so I reversed it to give me an itoa function. There is no way to access free memory, so I need to figure out…
Dylan Turner
  • 322
  • 1
  • 12
0
votes
1 answer

GCC 5.1.0-4 cross compiler build fail

I'm following the osdev.org bare metal tutorial, and I'm currently stuck at the cross compiler.! I'm building from an arch distro. It looks like it might be a problem with isl. I think the tutorial is based on an older version of gcc, cloog,…
nmg33
  • 3
  • 2
0
votes
1 answer

GCC linker does not link standard library

I'm developing a basic kernel for my term project. Until now, I haven't used any standard libraries in my project but I needed gets(), I included . GCC finds the header location but the linker gives error : ld -melf_i386 -Tlink.ld -o…
user2112559
0
votes
0 answers

Best practices on implementing text components from scratch

I've written a kernel with a small userspace, and currently I'm in the process of writing a window manager (from scratch). I made a library for basic drawing, ported freetype2 for text rendering and the windowing/input system/basic components work…
maxdev
  • 2,491
  • 1
  • 25
  • 50
0
votes
1 answer

Linker script not Settting the origin Correctly

I have been working on linking my C++ Kernel to my x86 Assembly Stage2 and It links without any errors but the problem is that When I boot up My OS on Virtual box it doesen't jump to Stage2 which leads me to believe that something is wrong with my…
AnonymousUser
  • 109
  • 1
  • 12
0
votes
1 answer

Scan the keyboard to obtain scan codes

So I'm learning how to make an OS. The problem is that every website says to scan the keyboard to obtain the scancodes in order to detect input. How do I 'scan' the keyboard? I know this question seems very ridiculous, but I really don't know how to…
0
votes
2 answers

Running a Kernel in VirtualBox

I have a bootloader and a kernel both written in assembly. Now I have two issues with these files. As the size of the bootloader is 512B, I am able to successfully run the .img file of the bootloader in VirtualBox. But: The size of the Kernel is…
0
votes
1 answer

Loading a .img file to floppy in virtual box

I have a Hello World Program in Assembly language `; ---------------------------------------------------------------------------- ; helloworld.asm ; ; This is a Win32 console program that writes "Hello, World" on one line and ; then exits. …
0
votes
0 answers

Kernel module driver programming (motivation)

Are there whatsoever some kinds of directives linux kernel developers go for, especially when writing drivers? - How drivers in the linux kernel are maintained. How can I (as a normal distro User) say if a driver works performant and is not just…
k t
  • 343
  • 5
  • 15
0
votes
1 answer

Mapping IRQs to interrupts vectors

Sorry for stupid question, but I don't understand how to map IRQs to interrupt vectors in protected mode (or long mode). Every information what I found is for real mode (http://wiki.osdev.org/Interrupts). In protected mode, vectors 0x8-0xf are for…
dev1223
  • 1,148
  • 13
  • 28
0
votes
2 answers

Booting assembly written kernel with grub

I know that with a simple kernel this small I don't actually need to boot it with GRUB but I am trying to learn how to do this before my kernel gets big and I need to boot it. I have written a simple kernel with assembly using the real mode assembly…