Page 1 of 1
Bootloader 4 tutorial problem
Posted: Sun Oct 05, 2008 7:15 am
by kweicht
I am having a problem getting tutorial 4 to work. This is the batch file I am using to build and set up the floppy:
Code: Select all
nasm\nasm.exe -f bin boot.asm -o boot.bin
partcopy boot.bin 0 200 -f0
nasm\nasm.exe -f bin stage2.asm -o stage2.sys
copy stage2.sys a:\stage2.sys
pause
This works fine, but it doesnt run correctly. I keep getting the "ERROR: Press any key to reboot" ...error. Even using Crypter's code does the same thing. Then I looked at his downloadable demo. His batch file uses
Code: Select all
PARTCOPY Boot1.bin 0 3 -f0 0
PARTCOPY Boot1.bin 3E 1C2 -f0 3E
That doesnt work for me. Partcopy complains that it cant write to dest offset. So I have two questions. 1. Why is he doing this anyway? I thought just copying the 512 bytes to the root was the solution. and 2. How can I fix it. Thank's a lot for any help.
Posted: Sun Oct 05, 2008 11:08 am
by Andyhhp
hi,
There is no advantage to doing
Code: Select all
PARTCOPY Boot1.bin 0 3 -f0 0
PARTCOPY Boot1.bin 3E 1C2 -f0 3E
over
so I would suggest you don't bother
As for the error, I assume thats an error from the bootloader and not from the BIOS. As Mike's code is doing this as well, it probably means there is something strange about the way your bios sets your computer up.
Can you post the specs please?
Andrew
Posted: Sun Oct 05, 2008 7:44 pm
by kweicht
Well I am using the bochs emulator, but the specs of my machine are as follows:
Intel Core 2 Quad Q9550
DFI X48-T3RS MB
4GB DDR3
9800GX2
Windows XP SP3
Also, I'm using a virtual floppy drive.
Posted: Sun Oct 05, 2008 8:10 pm
by Mike
This is what you should be using. The other PartCopy code is outdated and should not be used. It must have gotten skipped over by the last series revision. It doesnt really matter what you use, though.
The difference between the above and this:
Code: Select all
PARTCOPY Boot1.bin 0 3 -f0 0
PARTCOPY Boot1.bin 3E 1C2 -f0 3E
...Is that the first method overwrite the Bios Parameter Block on disk while the second method does not.
You mentioned this is tutorial 4, but tutorial 4's demo does not include that error string (Nor has stage 2). Are you sure it was from tutorial 4?
Posted: Sun Oct 05, 2008 8:56 pm
by kweicht
I'm sorry. Bootloader 4. Tutorial 6.
Posted: Sun Oct 05, 2008 10:13 pm
by Mike
I'm sorry. Bootloader 4. Tutorial 6.
No worries

I may need to create a better naming convention for the demos
In Stage1 the default image name to load is "KRNLDR.SYS", however you are using "Stage2.sys".
If you want to use Stage2.sys, you need to update this line with the new image name in Boot1.asm (Insure it is 11 characters):
...Or, just rename your output file from Stage2.sys to KRNLDR.SYS and it should work fine.
Posted: Sun Oct 05, 2008 11:23 pm
by kweicht
Wow, I feel dumb. Oh well, easy thing to miss. Thanks.
