use16
org 0x5000
start:
mov ax,3
int 0x10
mov ah,1
mov ch,0x20
int 0x10
mov ax,0x500
mov es,ax
mov ax,cs
mov ds,ax
mov si,pm_start
mov di,0
mov cx,100h
cld
rep movsb
pm_start:
cli
lgdt fword[gdtr]
mov eax,cr0
or al,1
mov cr0,eax
jmp 0x10:0x5000 ;0x10:0x8000
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 gdt
use32
pm_code:
mov ax,cs
mov ds,ax
mov ss,ax
mov byte[0xB8000],1
jmp $
Add a code snippet to your website: www.paste.org