|
Simple Boot Disk and Typer
|
|
10-07-2009, 09:23 AM
Post: #1
|
|||
|
|||
|
Simple Boot Disk and Typer
This is something I keep coming back to every now and then, my boot disk. I like this project/toy of mine because its all in 16 bit programming and well gcc is 32 and 64 bit(with limited support for 16 bit) so it makes for some playing around to get the code stripped down and working but in the end its really rewarding doing something at this level...
So what does my boot disk do? Well not very much, It'll boot a Intel/AMD machine load some code, create a stack, execute and then wait for the user to press a key - when the user presses a key it'll display it...Yeah I know pretty fantastic but its just a programing toy. So if the user presses the keys "slsdkflskjflsdksdsldjf" The program will display "slsdkflskjflsdksdsldjf" when the user has pressed more than 2000 keys the program will loop back to the top of the screen again and overwrite what's in place....Like I said very low featured...Anyways here's the code asem code that I stripped down and placed in the hex array in the C code below Code: .code16C code - The boot disk for Linux or a boot image that can be used with QEMU Code: #include<stdio.h>If you want to port this to windows then you'll have to port this line Code: floppy_desc=open("/dev/fd0",O_RDWR);//boot disk |
|||
|
10-07-2009, 09:28 AM
Post: #2
|
|||
|
|||
|
RE: Simple Boot Disk and Typer
Nice ... Now you're getting into some advanced C stuff(Also assembly
) I have only a minor understanding as to what code is doing what in the assembly .. but the C is sort of straight forward ( except for the hex) also is fcntl.h a windows library ( or standard?)
"Character is determined more by the lack of certain experiences than by those one has had." Friedrich Nietzsche |
|||
|
10-07-2009, 09:52 AM
(This post was last modified: 10-07-2009 10:03 AM by G4143.)
Post: #3
|
|||
|
|||
RE: Simple Boot Disk and Typer
(10-07-2009 09:28 AM)Back_track Wrote: Nice ... Now you're getting into some advanced C stuff(Also assembly Everything in the above C program is portable except fcntl.h and these lines Code: floppy_desc=open("/dev/fd0",O_RDWR);//boot diskIf you want to port it to windows then you have to find a way to write to the floppy device directly or binary write to a file to make a boot image that QEMU can boot from... |
|||
|
« Next Oldest | Next Newest »
|





) I have only a minor understanding as to what code is doing what in the assembly .. but the C is sort of straight forward ( except for the hex) also is fcntl.h a windows library ( or standard?)
