Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %define com1 0x3f8
  2.  
  3. bootentry: cli
  4.            mov ax,0x07c0
  5.            mov ds,ax
  6.            mov ss,ax
  7.            mov es,ax
  8.            mov sp,0x0800
  9.            sti
  10.            call setup_uart
  11.            cld
  12.            mov ax,0xb800
  13.            mov es,ax
  14.            xor di,di
  15.            mov si,fo
  16.            mov ax,10
  17.            push ax
  18.            pop cx
  19.            rep movsw
  20. hang:      mov dx,com1+3
  21.            in  al,dx
  22.            push ax
  23.            and al,127
  24.            out dx,al ; disable DLAB
  25.            mov dx,com1
  26.            mov al,'K'
  27.            out dx,al
  28.            pop ax
  29.            add dx,3
  30.            out dx,al ; set LCR back
  31.            jmp hang
  32.  
  33.  
  34. setup_uart: mov dx,com1+1
  35.             mov al,0
  36.             out dx,al
  37.  
  38.             mov dx,com1+3
  39.             mov al,0x80
  40.             out dx,al
  41.  
  42.             mov dx,com1
  43.             mov al,0x01
  44.             out dx,al
  45.  
  46.             mov dx,com1+1
  47.             mov al,0x00
  48.             out dx,al
  49.  
  50.             mov dx,com1+3
  51.             mov al,0x03
  52.             out dx,al
  53.  
  54.             mov dx,com1+2
  55.             mov al,0xC7
  56.             out dx,al
  57.  
  58.             mov dx,com1+4
  59.             mov al,0x0B
  60.             out dx,al
  61.             xor ax,ax
  62.             xor dx,dx
  63.             ret
  64. fo: db "H",0x0f,"e",0x0f,"y",0x0f," ",0x0f,"W",0x0f,"o",0x0f,"r",0x0f,"l",0x0f,"d",0x0f,"!",0x0f
  65. buffer: times 510-($-$$) db 0
  66. signature: dd 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement