![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0
![]() |
Can I ask one further question?
Can anybody advise me, how would I go about creating a self booting program on a self booting disk?
For example if I were to create a suitable 3.5" floppy disk that contained my assembly program and then is placed into the disk drive. Following a system reset (and boot strap permitting) my assembly program would then start up from the diskette, without any further prompting from the user. Thankyou in advance to anybody that replies (Im currently writing programs using the MASM compiler, and a text editor.) |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Indeed you can. The fact that you are asking indicates that you have a substantial amount to learn. In the typical PC, when you power up, the only software available is that which resides in the BIOS (Basic Input/Output System). There's quite a bit there, substantially more than in the original PCs, but it is, indeed, basic. It knows how to deal with keyboard, monitor, and disk I/O. There is no real executive - that's the job of the software that will boot. The boot record of the medium that is booted from will be placed in memory at a particular location and the processor will then be set to execute from a particular address. From there, everything is up to you.
I would suggest that you get your hands on an old MS-DOS diskette, say 3.3, get some ancient books dealing with MS-DOS, and work from there. You could also use C/PM, and old Unix or QNX, DRDOS, or a number of other things. MS-DOS is terrible, non-reentrant, but you would no doubt have more success locating documentation. If you take this approach and experiment around, I would recommend you remove your current hard drive or move it to another channel where you're less likely to access it and wipe it out. You will no doubt begin operations in real mode and you won't have the protective measures in place until you put them there yourself. Historically, a lot of early software was totally independent of even MS-DOS. One booted the whole ball of wax and ran it. Even the early MS Flight Simulators didn't use MS-DOS - it didn't have capabilities to address graphical issues in a timely fashion.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
There are a couple of tutorials out there on the internet, 15 minutes googling will give you enough results I guess.
Making the computer boot from the floppy is pretty easy: just place a 512 byte big piece of assembly on the first sector of your floppy. When your piece of assembly code is bigger than 512 byte, you'll have to load that piece into the memory by hand - the BIOS won't do it for you. For an explanation how to do this, use Google, because I don't know how to read from disk in 16 bit mode . The handiest is to put the extra piece of assembly on e.g. the 2nd sector, but note you won't be able to use a filesystem anymore. |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0
![]() |
Once again thankyou Dawei, I will persue this as you have laid out.
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0
![]() |
Sorry I have only just read your post Polyphemus.
Thankyou for your response, I shall indeed google it. Can you tell me how would I place a program onto a particular sector? |
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Search for making on how to make a boot loader and second stage loader.
It's generally discouraged to make your own bootloader, but if you really want to you can roll your own bootloader.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0
![]() |
Thankyou nnxion for your valuable aid!
(This looks extremely complex!, I had better get reading) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|