I'm not a newbie. I've programmed OSes before, but I haven't done any programming in two years. Well, now I'm writing my OS from scratch. I have a custom boot loader that loads my 32-bit kernel. My OS will be graphical like Mac OS X, with no command-line at all. In my boot loader, I set the VESA mode and get the VESA mode info for the linear frame buffer. This is what my code looks like:
Code: Select all
setup_vesa:
mov ax, 0x4F01
mov cx, 8113h
mov di, vesa_info
int 0x10
mov ax, 0x4F02
mov bx, 8113h
int 0x10
jmp go_to_pmode
--- some more code for entering 32-bit mode ---
vesa_info:
dw 0
db 0
db 0
dw 0
dw 0
dw 0
dw 0
dd 0
dw 0
dw 0
dw 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
.linear_frame_buffer_start dd 0
dd 0
dw 0
times 206 db 0
Code: Select all
mov edi, ebx ; boot loader passes linear frame buffer start in EBX
mov ax, 0xFFFF
mov ecx, 0xEA600
rep stosw
- Sayed Mohsen