Hello.
I integrate interrupts on this guide.
Everything seems to work, but the screen flickers. I use GRUB as a loader, at the end of the article it is written how this error is fixed, but I do not understand where to insert it, in what part of the code.
Now my bootloader looks like this.
Screen flashes after interrupts are activated
Screen flashes after interrupts are activated
Last edited by mrjbom on Mon Dec 02, 2019 9:57 am, edited 1 time in total.
-
- Member
- Posts: 5580
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Screen flashes after interrupts are activated
Nowhere. It's a bad idea to copy code you don't understand.
You need to set up the GDT before you can use the IDT, so perhaps read about the GDT first and come back if you have any questions.
You need to set up the GDT before you can use the IDT, so perhaps read about the GDT first and come back if you have any questions.
Re: Screen flashes after interrupts are activated
You can implement GDT table code from Interrupt tutorial to your code with:
Code: Select all
bits 32
%define MULTIBOOT_MAGIC 0x1BADB002
%define MULTIBOOT_FLAGS (1<<0 | 1<<1 | 1<<2)
section .text
align 4
multiboot_header:
dd MULTIBOOT_MAGIC
dd MULTIBOOT_FLAGS
dd -(MULTIBOOT_MAGIC + MULTIBOOT_FLAGS)
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 800 ; width
dd 600 ; height
dd 32 ; bbp
global start
extern kmain
start:
cli
mov esp, stack_space
push ebx
push eax
jmp load_gdt
;global descriptor table
gdt:
gdt_null:
dq 0
gdt_code:
dw 0FFFFh
dw 0
db 0
db 10011010b
db 11001111b
db 0
gdt_data:
dw 0FFFFh
dw 0
db 0
db 10010010b
db 11001111b
db 0
gdt_end:
gdt_desc:
dw gdt_end - gdt - 1
dd gdt
;load gdt
load_gdt:
lgdt [gdt_desc] ;load GDT
call kmain
hlt
section .bss
resb 8192
stack_space:
Re: Screen flashes after interrupts are activated
You should write your own code, the code in the wiki is terrible.
Lots of duplication, no explanation on how it works, what it does, etc.
In OSdev it is vital that you understand what your code is doing and why. It will make debugging later on a lot easier.
Lots of duplication, no explanation on how it works, what it does, etc.
In OSdev it is vital that you understand what your code is doing and why. It will make debugging later on a lot easier.
Re: Screen flashes after interrupts are activated
Thanks for your help. I just did not know how to use the code from the tutorial.Klakap wrote:You can implement GDT table code from Interrupt tutorial to your code with:
Re: Screen flashes after interrupts are activated
Hello again.Klakap wrote:You can implement GDT table code from Interrupt tutorial to your code with...
I updated bootloader but it didn't solve the problem. I don't know what it is, it should have solved it. Do you know what else might be the problem? I hope for your help.
You can read the code in the repository
I hope you all will be clear, I don't have time to put in the repository, sorry.
Re: Screen flashes after interrupts are activated
Code: Select all
load_gdt:
lgdt [gdt_desc] ;load GDT
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp 0x08:.setcs
.setcs:
Code: Select all
lgdt [gdt_desc]
jmp 0x0008:fix_cs
fix_cs:
mov ax, 0x0010
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov esp, stack_space ;set stack pointer to your point
call kmain