flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Bootloader... |
Author |
|
vid 18 Jul 2005, 07:49
how to place - look at interrupt 13h description
|
|||
18 Jul 2005, 07:49 |
|
smiddy 18 Jul 2005, 10:39
What operating system are you using to develop with?
|
|||
18 Jul 2005, 10:39 |
|
coconut 18 Jul 2005, 15:57
i may be off, but you need something like rawwrite to place your bootloader at sector 0 of a floppy to be bootable.
http://flatassembler.net/examples/phboot.zip - this is a nice bootloader example and includes source for a utility to write to sector 0 of a floppy too |
|||
18 Jul 2005, 15:57 |
|
tspier2 18 Jul 2005, 21:19
I was mainly using Windows for the coding, although I've decided that I'm switching entriely over the Linux, because I have experience with it.
|
|||
18 Jul 2005, 21:19 |
|
Night Rider 28 Jul 2005, 00:13
Quote:
The Linux Really, it is monolithic kernel system... with opened sources If other questions, you always can ask me mndos@yandex.ru i'll be glad to help You, because i have done all this way completely myself... |
|||
28 Jul 2005, 00:13 |
|
tspier2 28 Jul 2005, 00:17
I know that. I was asking more specifically for advice with writing a bootsector to the floppy diskette.
|
|||
28 Jul 2005, 00:17 |
|
crc 28 Jul 2005, 01:33
On Linux you can do "dd if=bootsector of=/dev/fd0" to write the boot sector to a floppy.
|
|||
28 Jul 2005, 01:33 |
|
LocoDelAssembly 28 Jul 2005, 02:45
If you are using FASMW maybe you want to develop in this way:
Code: org 100h mov ax, 0301h mov bx, bootCode mov cx, 1 xor dx, dx int 13h jnc @f mov dx, msgErr mov ah, 09 int 21h @@: int 20h msgErr db "Write error$" bootCode: org 7c00h push cs pop ds mov si, msg jmp loadChar printChar: mov ah, 0eh int 10h loadChar: lodsb test al, al jnz printChar xor ax, ax int 16h xor ax, ax int 19h msg db "Remove disk and press any key", 13, 10, 0 if $-7c00h > 512 display 'WARNING: boot code is more than 512 bytes' end if In this way you just press F9 and the boot code will be compiled and written to floppy. Of course you can change the code below the bootCode label, it just an example. [edit] WARNING: this method replaces the first 512 bytes of the floppy disk, if you have files in the diskette will be difficult to get them back (floppy disk will appear as unformatted)[/edit] |
|||
28 Jul 2005, 02:45 |
|
Night Rider 28 Jul 2005, 11:01
Use Disk Editor. I used it, it is very good utility! Specialy, to put sector. Just compile it, run DE and write to PHYSICAL floppy device.
|
|||
28 Jul 2005, 11:01 |
|
bogdanontanu 28 Jul 2005, 14:11
OR you could use rawwrite or rawwritewin
|
|||
28 Jul 2005, 14:11 |
|
THEWizardGenius 28 Jul 2005, 19:22
Well if the disk is FAT you'll want to include the BPB (Boot Parameter Block) - http://home.freeuk.net/foxy2k/disk/disk3.htm - But with FAT you need to be able to load a file.
The whole point of a bootloader is to load a kernel from the file system into memory and execute it. On a disk with no file-system you can put the kernel in whichever sector you want. Most disks, however, you want to copy your kernel to the disk and load it from the filesystem. If you have a FAT [12|16|32] on your disk, then you will need to learn about the FAT filesystem - see http://home.freeuk.net/foxy2k/disk/disk1.htm for that information. However, the easiest thing is to use a pre-made bootloader that loads a file from a FAT disk. In the Examples section on the main FASM website, there is one. You might convince the MenuetOS people to let you use theirs. Or you can use one written in a different language. I have used John S. Fine's FAT12 bootloader, written in NASM, in the past. I took the pre-compiled binary, hex-edited it to add a loading message and change the filename (that was HARD work ) and used that. Use whatever works for you. Even if you aren't using any file system, you'll need to load the kernel from the disk. Most people would just store it in the sectors directly following the boot sector. Wherever it is, you use BIOS INT 13h to read/write these. Here's a reference on how to use it: http://www.xaff.org/GI/biosref.html You should use rawwrite or rawwritewin in DOS or Windows, or the dd command in linux, to write to the bootsector. You may want to backup what's currently there first. You can also use the free partcopy to write to the disk; I found PartCopy (John S. Fine's program) helpful because it works in Windows, and you can write a batch file for it. For example, I wrote a batch file for (a)compiling my bootloader and (b)writing it to disk. You can write a shell script for "dd" in linux, and a batch file for rawwrite, but only in DOS. Good luck! |
|||
28 Jul 2005, 19:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.