Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading Kernel, Have Bootloader

Status
Not open for further replies.

Kolie

Programmer
Jan 22, 2002
1
US
Ok i have a working bootloader, basically displays a message waits for keyboard hit and resets lol. I also wrote a program to write bins to the boot sector of a floppy, quite fun indeed hehe. My problem is loading some assembled code, like a kernel or something, from my bootloader. I need to know how to, put my kernel onto my floopy, read the kernel in from the floopy, put it in memory somewhere, and begin executing code from it, hehehe simple right? Ive looked at source code from bootloaders but they arent helping me much. Anyways help is always appreciated!

------------------------------------
If the program is running fine then
that is only a special case of an
error
------------------------------------


 
hello,
link your kernal & boot loader to EXE.
you have to write several programs to help you develop.
The first is an EXE un-cooker. Basically this extracts the code from the EXE into a UNC file (UNC=uncooked,removes begining paragraph by using 08h integer count of paragraphs)
The second writes your bootloader to sector0 and the UNC file to the following sectors.
The bootloader loads into 07C00h, the bootloader should copy the after sectors into memory (place after BDA) then execute (run your kernal).
When you write your bootloader and kernal you have to manually take care of your stack,GDT,segment&offsets etc.
Once you have developed your kernal you can write your own assembler and routines and can dump these programs.
straiph
 
I think you can use debug to uncook exe's....

Isn't 'uncook' what exe2bin does? You can simulate what exe2bin does using debug, though it's been a time since I did that and I can't remember it anymore... "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
YES! exe2bin.exe is just what you need to un-cook an exe file. there are plenty of free equivalents around to download.
Straiph
0000:0000:0000:0000h
The people who have nothing to say and say it too loud have little knowledge, It's the quiet ones you need to worry about!
 
You don't even need to DOWNLOAD an exe2bin replacement...

Windows 98 and lower still ship debug. I'm not sure if later Windows still ship it.

Try the following:
at ms-dos prompt:
debug filename.exe

at debug prompt:
N filename.bin
W
Q
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
you need to modify the exe2bin program because it wont create a com or sys file if it has things in like a stack or far jumps etc.

I got the asm source code downloaded for exe2bin and removed all of the checking so it would give me the compiled code into a com file regardless of its contents.

Straiph
0000:0000:0000:0000h
The people who have nothing to say and say it too loud have little knowledge, It's the quiet ones you need to worry about!
 
I still suggest you try what I said (the debug method). Debug doesn't care about stack and stuff. That way you won't need to remove all the checking yourself.

Straiph, just a suggestion, suppose you make that version available? Course it's copyrighted, but maybe you can release a step-by-step procedure or patch to replace the checking with NOP's so that others won't have to reinvent the wheel?
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
AmkG
I have added an FAQ in response to your request.
Straiph.
0000:0000:0000:0000h
The people who have nothing to say and say it too loud have little knowledge, It's the quiet ones you need to worry about!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top