Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted by Ivan_32 ( 15 years ago )
org 7C00h
use16
KERNEL_SECTS equ 10
SETUP_SECTS equ 4

start:
    xor ax,ax
    mov es,ax
    mov ds,ax
    mov ss,ax
    mov sp,7C00h
fdd_read:
    mov ax,0x500
    mov es,ax
    xor bx,bx
    mov ah,2
    mov al,KERNEL_SECTS
    mov cx,2
    xor dx,dx
    int 0x13
video_mode: 
    mov ax,3
    int 0x10
    
    mov ah,1
    mov ch,0x20
    int 0x10
gdt_reloc:
    cli
    mov ax,0x800
    mov es,ax
    mov ax,cs
    mov ds,ax
    mov si,gdt
    mov di,0
    mov ecx,24
    rep movsb
    
    mov ax, 0x1000
    mov es,ax
    mov si,pm_start
    xor di,di
    mov ecx,gdt-pm_start
    rep movsb
    jmp 0x1000:0
pm_start:
    cli
    lgdt fword[gdtr]
    mov eax,cr0
    or  al,1
    mov cr0,eax
    
    jmp 0x10:0x5000

gdt:        dw    0x0000, 0x0000, 0x0000, 0x0000
sys_data:   dw    0xFFFF, 0x0000, 0x9200, 0x00CF
sys_code:   dw    0xFFFF, 0x0000, 0x9800, 0x00CF
gdt_end:
gdtr:       dw gdt_end - gdt - 1
            dd 0x8000
TIMES 510-($-start) db 0
dw 0xaa55
include "kernel.asm"

 

Revise this Paste

Parent: 10782
Your Name: Code Language: