0 Replies - 1532 Views - Last Post: 24 June 2010 - 04:44 PM

#1 nathanpc   User is offline

  • SCIENCE!
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Booting a Kernel In The Middle Of a Floppy

Posted 24 June 2010 - 04:44 PM

Description: When you have a kernel on some part of a floppy, that isn't the boot sector, you can use this to boot it up. You need to be using Fasm to compile this source. The code is very well explained, then it is very simple to understand.When you have a kernel on some part of a floppy, that isn't the boot sector, you can use this to boot it up.
org 7C00h

    mov ax, 1000h 
    mov ss, ax 
    mov sp, 0		; Points to the top of the stack
    mov ax, cs 
    mov ds, ax 

    mov ah, 02h 	; Read sub function 
    mov al, 1		; Number of sectors to read 
    mov ch, 0		; Cylinder 
    mov cl, 2		; Sector 
    mov dh, 0		; Head 
    mov dl, 0		; Drive (00h = A:) 
    mov bx, 0800h	; ES:BX Points to the memory location
    mov es, bx		; Where the data will be written 
    mov bx, 0		; 0800:0000h (ES = 0800h, BX = 0000h) 
    int 13h		; Floppy interrupt
    
    ; Turn off the floppy drive
    mov   dx,3F2h
    mov   al,0
    out   dx,al


Is This A Good Question/Topic? 0
  • +

Page 1 of 1