Questions tagged [osdev]
Operating System development: kernel, shell, networking, cross-compiling, etc.
1,105
questions
0
votes
0
answers
18
views
Confused about memory holes
I'm trying to make a small 64-bit kernel (x86), and i recently found out about memory holes, but even after googling for a while i couldn't find all the answers i wanted.
If i understand it correctly, ...
0
votes
0
answers
20
views
Implementing a passthrough file system (fuse-fusepy)
I want to create a filesystem that will hold both clear and encrypted versions of each file. It will then serve one or another depending on user authentication. I'm using fusepy for this. I'm starting ...
1
vote
0
answers
52
views
Crash when enabling Interrupts while using an Interrupt Descriptor Table
My qemu emulation just crashes after running init_idt() and then enable_interrupts(). I cant find the error, did i setup the IDT wrong or am i missing something. I am in 32bit protected mode on a x86 ...
0
votes
1
answer
120
views
OSDev -- double buffering rebooting system
Hello I'm trying to make a simple os, and I'm currently trying to do double buffering.
I have two arrays in the size of the screen and a function that copy the array that currently is being used to ...
0
votes
0
answers
34
views
RPI4B bare metal RNG
I am working on a bare metal operating system for the Raspberry Pi 4B, and have run into a bit of an issue. I need a random 64bit number to use as a guard value for the stack smashing protector. I ...
0
votes
0
answers
55
views
How to draw on the screen without VESA, GOP, UGA
I recently took up osdev, and I had a question. How to draw a basic Windows and Linux video driver on the screen, regardless of the type of boot (UEFI, BIOS). I want to write something like this, and ...
0
votes
1
answer
105
views
How to fix Disk Read error when trying to read sector
I am following this tutorial on building a simple operating system. My problem is it calls a disk load function, and when I boot it up, it gives me a Disk read error. Here is my boot_sect.asm code:
[...
1
vote
0
answers
72
views
Making a serial mouse handler in x86 assembly
I've found Making a mouse handler in x86 assembly and the code works in qemu but not in pcem or 86box. I've noticed that pcem and 86box have the word serial after the device name so I'm assuming that ...
1
vote
1
answer
94
views
Can't setup GDT on Multiboot (Triple fault?)
i am trying to setup GDT from my simple kernel that uses multiboot and i don't know what's happening (i think it's triple fault). when using the qemu monitor trying to debug it but i didn't success ...
0
votes
1
answer
36
views
Can you make an operating system which would support programs written for another operating system
If you were to make your own operating system, and make the syscalls "the same" as those of another operating system, would you be able to run programs made for that operating system ...
0
votes
0
answers
117
views
How to detect when a key is pressed?
I am using elf-gcc (x86_64) and I already have a working operating system that writes some text to the screen. As I would like to create commands that do simple actions I need to detect when the user ...
0
votes
0
answers
39
views
Why keyboard IRQ number is exactly 1?
I just very much wonder if this is the number set to stone,
Is it standard that everyone must follow?
As I can understand it's caused by the fact that it's connected to first interrupt line in the PIC....
1
vote
0
answers
36
views
SMBIOS 3 Get Structure table address and number of structures
I'm coding an standalone smbios library. Following the standard 3.6.0 by DMTF.
See edit for a partial answer (Unsure if it is optimal)
It works just fine for SM tables (32 bits) but I can't seem to ...
0
votes
0
answers
43
views
Python.h: #error unknown multiarch location for pyconfig.h, for i686 gcc, what can I do about it?
Using Python.h, I am calling a function from my Python file, arsenic.py, using C.
I use i686-elf-gcc to compile this C file (trying something crazy, so I cannot change this).
Then I encounter these ...
0
votes
0
answers
73
views
Not able to write to Videobuffer in own OS
I started writing a small OS and at the moment I don't have any build problems and it looks like everything is working, just something isn't working. I go into video mode in the bootloader and then ...
0
votes
0
answers
29
views
My os is not printing out characters to the screen [duplicate]
My kernel is not printing characters onto the screen.
This is my boot.asm file:
global _start
section .text
_start:
; Set up the stack
mov esp, 0x90000
; Load the kernel
mov ah, 0x02 ...
0
votes
0
answers
26
views
Cant find -lgcc_s when compiling C-Code in an docker container
I am working on my own OS but when compiling I am getting the following errors:
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld ...
0
votes
0
answers
18
views
The linker is not linking the C and asm object files [duplicate]
I'm working on an OS and I'm trying to get it to load. I have a dummy kernel for now, and I'm trying to get my bootloader to load it im using a make file to do it faster and it keeps giving the same ...
0
votes
0
answers
53
views
Can't build OS image with Scons. Where i made mistake? [FIXED]
i'm trying to studying in OS development but now have some troubles with SConstruct scripting.
First at all, i'm follow the YT tutorial of OS development.
(Link: https://www.youtube.com/watch?v=...
0
votes
0
answers
55
views
Bootloader doesn't seem to be loading the kernel, but also doesn't send any errors
I made a bootloader in assembly but it doesn't load the kernel, it also won't display any errors. My bootloader is as follows:
org 7C00h ;start at
bits 16 ;16bit real mode
%define endl 0Dh, 0Ah
jmp ...
0
votes
0
answers
40
views
Osdev linker multiple defintions inside docker error
I was planning on working on my os after a long break. Back then I was working on a amd64 system so no issues building, but now since im working on my m1 mac I have to use docker. Suprisingly i still ...
0
votes
0
answers
83
views
Weird characters after implementing bootloader Assembly OS
I just implemented a bootloader in my small Assembly OS. It appears to be working, since it boots straight in the kernel. There is one problem, the characters are not correct, this was not a problem ...
0
votes
0
answers
38
views
Is UEFI returning a false memory map or has QEMU an error?
I have a bootloader written with UEFI. I use -m 100M when running QEMU and I excpected to have about 100M of memory when using BS->GetMemoryMap(); But I got about 350M which is weird. Following is ...
0
votes
0
answers
106
views
Why are interrupts not triggered during an infinite printing loop task
Specifically, I have two tasks fn and fn1 that are being run by a scheduler. The code for each is below:
int fn(void *arg)
{
for(;;) {
printf("a");
}
return 6;
}
int fn2(void *arg)...
0
votes
1
answer
64
views
Why does disk read function lead to page fault
The following function that reads the FAT BPB results in a page fault:
fat_bpb* fat_read_bpb(){
fat_bpb* bpb = kmalloc(sizeof(fat_bpb));
ide_read_sectors(DRIVE, 1, 6, (uint32)bpb);
return ...
3
votes
0
answers
164
views
Does the CS register need to be set when setting up Unreal Mode?
The OSDev Wiki describes the general procedure of switching to unreal mode, with an example bootloader:
ORG 0x7c00 ; add to offsets
start:
xor ax, ax ; make it zero
...
0
votes
0
answers
33
views
qemu is returning no output after file is fed
I am very new to making operating systems so this question is pretty dumb, the following code gives me no output on Qemu(x86_64)
[org 0x7c00]
section .text:
mov ah,0x0e
mov bx,mystr
jmp ...
1
vote
3
answers
79
views
How to add color in assembly OS code in qemu?
I am trying to set red color for text in this code:
[bits 16] ;кажемо коду що юзаєм 16 бітний формат
[org 0x7c00] ;адрес де біос буде завантажувати бутлоадер
start:
xor ax, ax
mov ds,...
1
vote
1
answer
73
views
Enabling Paging restarts QEMU
In my paging code, qemu restarts because of some of the inline assembly. It could be something else, but removing the assembly causes the program to work fine. Alternatively, it could be possible that ...
2
votes
1
answer
87
views
INT 13h cannot read beyond specific sector
I am writing a kernel for my operating system and I have ran into a problem while loading a sector of a disk to memory.
Here is the portion of the code of the function that loads the sector from the ...
2
votes
1
answer
168
views
Kernel message not displaying in custom OS: Bootloader or Kernel issue?
I am building an operating system and am experiencing a problem where the bootloader successfully prints its message, but the kernel's message isn't displayed. Here's a breakdown:
Setup:
Assembler and ...
2
votes
0
answers
53
views
init gets killed on syscall
I'm trying to build an OS on a 32 bit Linux kernel. I made start.S and init.c and executed them, but init keeps getting killed when syscall is made. How can i fix it (start.S and init.c combine to /...
1
vote
0
answers
52
views
Is there a way to jump to long mode using an indirect jump?
I am writing an operating system and have just started the other CPUs, so I am in assembly on each now. I have set up long mode and now I just need to perform a far jump. However, when I try to do any ...
1
vote
0
answers
57
views
variable won't update in ISR
this is an ISR that gets executed whenever an IRQ1 is fired, but something weird is happening the data at memory location 0xb8100 is not updating, but IRQ1 is firing and the ISR is executing (I ...
0
votes
0
answers
74
views
Can't mask IRQ using PIC
I've been trying to setup interrupts in an x86_64 protected mode kernel in order to use the keyboard interrupt. I have loaded the IDT, remapped the PIC, the keyboard IRQ works but I keep receiving INT ...
1
vote
1
answer
87
views
How to print pixels in 1024x768x32 resolution (OS Development)?
So, I recently got into operating system development a while ago, and I've made some good progress. I'm working in assembly language, C, and C++, with C++ as the language of my main kernel and drivers....
1
vote
1
answer
149
views
Why won't my code draw a white pixel to the screen?
I'm making an OS that runs snake, and I'm in 32 bit protected mode, But I can't draw a pixel to the screen. I switch to Mode 0x13 (320x200x256) in real mode and the screen blanks. After entering ...
1
vote
0
answers
40
views
why my os doesn't switch to protected mode
I started creating an os entirely in assembly thinking I wanted to do it completely in real-mode, but as soon as I realized the limitations I had, I decided to create the bootloader in real-mode and ...
0
votes
0
answers
48
views
Why is my boot-loader crashing on far jump into protected mode?
I have trying to boot into a kernel made in C. I have been learning and attempting to make a functional boot loader for a while now, however it always fails in one spot or another. I am using the gnu ...
0
votes
0
answers
33
views
Adding hardware interrupts handeling breaks the program
I'm working on a simple OS and I've managed to set up the IDT table and now I'm working on hardware interrupts and the PIC's.
In isr.c there is an array of functions and the isr handler calls the ...
2
votes
2
answers
67
views
OS on a real-machine
I create a small os (not finished) only with assembly 16 bit that works with qemu-system-i386.
But now i want to test it on a real machine and in case of errors make it compatible with a real PC.
This ...
1
vote
1
answer
47
views
Assembly 16bit real mode - CMPS return always 0
I want to make a small operating system in 16 bit assembly.
In this code I'm creating a sort of 'terminal' where I take the user input and if the input is shutdown then start the function to shut ...
0
votes
0
answers
67
views
display library 'carbon' not available
i'm currently making an os, and have an issue, and wanna debug what's going on. I'm on mac, i use bochs.
So basically i ran bochs -f bochs_config, and bochs_config:
megs: 128
romimage: file=/usr/local/...
0
votes
1
answer
80
views
registers not loading properly in ISR's
I'm trying to make a simple OS and I'm currently working on setting up the interrupts.
The way it works is that there is an assembly function that pushes all the registers, the interrupt number and a ...
0
votes
0
answers
51
views
Is there a way to tell the kernel to use an offset at runtime
I am trying to write a OS and make it total with something new, take ideas from my mind and just dont copy from the internet i have done it everywhere i could as memory management process creation, ...
1
vote
0
answers
51
views
Qemu: booting failed
I started making an OS entirely in assembly (by my choice) but when you run it it doesn't work.
There are the files..
bootloader.asm:
section .text
global _start
_start:
cli
xor ax, ...
1
vote
1
answer
51
views
mcopy alternatives for windows users
I am trying to compile a custom operating system by following a youtube tutorial. However the video instructs using mcopy, from gnu mtools, of which I cannot seem to install using the package managers ...
0
votes
1
answer
106
views
bochs: fetch_raw_descriptor: GDT: index (bf) 17 > limit (17)
I'm trying to make a simple OS and I'm currently working on interrupts and the IDT.
So I implemented the IDT and a default exception handler that currently doe's nothing.
And when I run my OS in bochs ...
0
votes
0
answers
112
views
KVM internal error suberror 1 when filling the CR3 register
I'm working on a x64 uefi bootloader to load a hobby OS. I'm running on AMD (Ryzen 7 5700G) with kvm, and when I try to fill the CR3 register with my PML4, I get a KVM internal error with 5 extra data
...
1
vote
1
answer
134
views
GRUB not Switching to Graphics Mode in Custom OS Development
I am developing a custom operating system and using the GRUB bootloader to load my kernel. In my development process, I've encountered an issue where I am unable to switch the display mode from text ...