117 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
50
views
How can a segment register with 16bit point to a segment descriptor in 32 protected mode
My understanding is i386 has segment registers with 16bit like CS it can point to code_descriptor in the GDT that should be in the RAM, to be able to reach to it we need 32bit address : How can CS ...
1
vote
0
answers
69
views
Segment selector pointing to invalid descriptor. GP# Fault occurs on STI
I am trying to setup GDT/IDT/Paging. Below code is what i do,
global start
global CODE_SEG
global isr_asm
global DATA_SEG
global loadGDT
global isr_wrapper
extern main
extern isr
section .text
bits ...
1
vote
1
answer
103
views
32 bit OS crashes after jumping to reload the code segment
Here's the code for resetting the segments:
global reloadSegments
section .text
reloadSegments:
; Reload the CS register with an offset of 0x08
jmp 0x08:.reload_CS
.reload_CS:
...
1
vote
1
answer
308
views
Why GDT is not working in the x86_64 System?
I want to enable GDT in x86_64 OS. I have written following codes to enable the GDT.
struct gdt_entry
{// 128 Bit
uint16_t limit_low; // Lower 16 bits of the segment limit
uint16_t ...
2
votes
0
answers
170
views
How to solve Triple fault in my x86_64 OS GDT?
I want to enable GDT in x86_64 OS by init_gdt() function in kernel.c Where, gdt_entry_t is looks
struct gdt_entry_struct
{// 128 Bit
uint64_t limit_low :16; // limit = 16+4 = 20
...
1
vote
1
answer
140
views
Why do the x86 32bit protected mode register not giving right value?
I have set 32 bit protected mode and try to load Global Descriptor table(GDT) by C and assembly and try to print the different registers value by check_gdt() function where
void check_gdt() {
...
0
votes
1
answer
83
views
Attempting to change into 32-bit protected mode causes triple fault
I have a simplistic bootloader comprised of two parts - the actual bootloader that loads the second 'stage' into memory, and executes it.
In that second stage, I'm trying to switch to 32-bit protected ...
0
votes
0
answers
138
views
My code is causing a triple fault after loading my Global Descriptor Table
My OS is triple faulting when I load my GDT.
I am following these two articles from the osdev wiki:
https://wiki.osdev.org/Global_Descriptor_Table
https://wiki.osdev.org/GDT_Tutorial
When I load my ...
2
votes
1
answer
176
views
Triple fault when jumping to long mode x86_64
I have hobby OS and I want it to jump to 64 bit long mode, everything work fine before far jump to 64 long mode entry, paging works correctly, but QEMU log file shows that EFER values is LMA
Triple ...
user avatar
user24726739
2
votes
0
answers
206
views
Why does linux use different GDT for each CPU?
I don’t understand the reason behind using different GDT for each CPU in multiprocessor systems (in linux).
The TSS descriptor needs to be unique for each CPU, but we could create a descriptor per CPU ...
0
votes
0
answers
212
views
x86 Updating GDT in Long Mode
Once in long mode, is there a straightforward way of loading a new GDT without immediately causing a general protection fault?
The issue is that as soon as the new GDT is loaded with lgdt, it seems ...
1
vote
0
answers
177
views
External Interrupts failing to be called
I'm creating a hobby x86_32 bit kernel using C, and simulating it with qemu-system.
After creating a VGA driver, I implemented a GDT successfully (or did I?), after setting up internal and external ...
0
votes
1
answer
274
views
GDT Flush fails the entire kernel
I am writing an x86_32 bit kernel from scratch in C, after writing a VGA driver, I have been trying to implement the GDT as well as the interrupts for a keyboard driver. However, my GDT_flush() ...
1
vote
0
answers
305
views
custom OS chrashes while loading GDT
I am building a simple OS in c++ to learn about the topic. I am using the limine bootloader (Limine 6.20231210.0, as stated by the bootloader version request). One of the first things i am doing in ...
1
vote
0
answers
76
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 ...