Linux Boot Disk with A Twist - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Programming with C++ (https://www.supportforums.net/forumdisplay.php?fid=20) +---- Thread: Linux Boot Disk with A Twist (/showthread.php?tid=591) |
Linux Boot Disk with A Twist - g4143 - 10-08-2009 I created a small program that will create a boot disk(Intel/AMD) and a very simple text editor and by simple I mean simple. The enclosed programs are: 1. The assembly code for the hex array included in the C code...What does it do? Well the code, when written directly to the floppy device will create a boot disk that has a stack and code space and the routines that will ennable a very simple text editor...i.e what you type in will be displayed. .Its very simple program just some 16 bit programming I play with when I'm bored 2. The C code just grabs the hex array(the assembler from above) and writes directly to the floppy device, hence creating a bootable floppy A few things to note - This is not a virus or anything like that. If you don't trust me then get an Intel/AMD manual and check the opcodes, the manuals with bear out that it is what it is. This will only work on a Linux box because of this line floppy_desc=open("/dev/fd0",O_RDWR); But you can port it to Windows if you like So how do I create a boot disk? Copy the C code and compile, Insert a floppy into the the drive and execute. Now just boot off the floppy and start typing when the blue screen appears.. If you don't have a floppy then you could download QEMU and boot it there. Just comment out this line //floppy_desc=open("/dev/fd0",O_RDWR); and uncomment this line floppy_desc=open("dosimage",O_RDWR|O_CREAT, 0666); Then compile and execute the dosimage file with QEMU like qemu dosimage assembly code Code: .code16 The C code Code: #include<stdio.h> Have fun with it RE: Linus Boot Disk with A Twist - Code King - 10-08-2009 Very cool man, on the weekend im defiently compiling this. Great Job. RE: Linus Boot Disk with A Twist - g4143 - 10-08-2009 (10-08-2009, 12:13 PM)Code King Wrote: Very cool man, on the weekend im defiently compiling this. Great Job. You should try 16 bit programming its very cool...G4143 RE: Linus Boot Disk with A Twist - Code King - 10-08-2009 Got any good resources? RE: Linus Boot Disk with A Twist - g4143 - 10-08-2009 (10-08-2009, 01:27 PM)Code King Wrote: Got any good resources? No I don't have any fix resources...its just kind of picked up here and there...G4143 You could try this link: http://www.freebyte.com/programming/assembler/#assemblyresources RE: Linus Boot Disk with A Twist - Code King - 10-08-2009 Thanks bro. RE: Linux Boot Disk with A Twist - Malevolent - 10-10-2009 nice job man RE: Linux Boot Disk with A Twist - g4143 - 10-10-2009 (10-10-2009, 09:29 AM)Malevolent Wrote: nice job man Thanks I'm just in the process of updating this simple editor...The code is now cleaner and the editor behaves a little more like an editor now |