So I'm writing this program in assembly, which is supposed to boot from my first hard disk, and when it's done, simulate a boot from my second hard disk, on which I've got an OS. So I load the boot sector to 0:7c00, reset all registers to their appropriate values, and jmp. The problem is that no matter how I tweak the state of CPU before I transfer control to the OS loader, it always gives me some bullshit like "Failed to load operating system." or "Invalid operating system.", i.e. it fails to load the kernel for some reason. Here's my current boot simulation code: ; read boot sector from 81h
mov ah, 2
; where from
mov dl, 081h
mov dh, 0
mov ch, 0
mov cl, 1
; how much
mov al, 1
; where to
xor bx, bx
mov es, bx
mov bx, 07c00h
; read it
int 013h
; reset shit
xor ax, ax
mov ds, ax
mov ss, ax
mov es, ax
mov ax, 0aa55h
mov bx, 10
mov cx, 1
mov dx, 081h
mov sp, 28452
xor bp, bp
xor si, si
xor di, di
; interrupts should be enabled i guess
sti
; go!
jmp 00000h:07c00h
So, I'm assuming I'm setting some registers wrong or that I need to modify something in the System Information Area or whatever, but I have no clue what I need to do. Any help is greatly appreciated!
Name:
Anonymous2011-09-26 5:35
>>15
That was supposed to be a new thread. Oh well. Please spare some knowledge for an old buccaneer.
BIOS sometimes checks master boot record partition table. Don't fuck with that. It's on MBR sector at like 440 or something. I forgot.
Name:
Anonymous2011-09-26 6:59
>>17
I don't know whether I'm an idiot or just tired, or maybe you're an idiot, but that doesn't help me much. I can't make much sense of it. I think I'll need someone to give it to me in plain old english.
>>15
Don't fuck with dl and the stack. And try jumping to 7c0h:0 instead.
Name:
Anonymous2011-09-26 7:10
>>18
It demonstates how to preserve initial state of a boot, load something with 13h 048h, then restart boot. dl is the boot drive. You'll have to figure-out your 1st and 2nd drives.
My bootloaders work on one drive and I have two, so I use Grub. I don't like cluttering my code with a bootloader for two drives.
God says...
C:\TEXT\HAMLET.TXT
of the money (if any) you paid for this etext by
sending a request within 30 days of receiving it to the person
you got it from. If you received this etext on a physical
medium (such as a disk), you must return it with your request.
ABOUT PROJECT GUTENBERG-TM ETEXTS
This PROJECT GUTENBERG-tm etext, like most PROJECT GUTENBERG-
tm etexts, is a "public domain" work distributed by Professor
Michael S. Hart through the Project Gutenberg Association at
Carnegie-Mellon University (the "Project"). Am