flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > bootloader to disk: |
Author |
|
shoorick 30 Aug 2007, 05:23
after adding bootsector with this way (boot.bin should be correct!) other content of the floppy stay intact.
next usage of format not neccessary - it will remove files from disk. |
|||
30 Aug 2007, 05:23 |
|
dosin 30 Aug 2007, 05:55
I have tried it both ways and its not working...
the boot loader is 512 bytes.. Any suggestions? |
|||
30 Aug 2007, 05:55 |
|
shoorick 30 Aug 2007, 06:09
show your boot.bin: binary or source (both even better)
--------- the matter is: bootsector contain boot code and disk geometry table. usually templates contain geometry for standart 1.44 floppy. in case this table is damaged or not match to disk parameters then disk may be not recognized. |
|||
30 Aug 2007, 06:09 |
|
shoorick 30 Aug 2007, 06:13
dosin wrote: debug boot.bin wait! it's wrong! should be: -w 100 0 0 1 with "debug boot.bin" boot.bin is loaded at 100h offset (as dos com file)! _________________ UNICODE forever! |
|||
30 Aug 2007, 06:13 |
|
dosin 30 Aug 2007, 06:49
C:\>debug boot.bin
-w 100 0 0 1 -q C:\>a: The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. C:\> This is what I get when I use 100 I did this along time ago and used w 100 0 0 1 Then formated the floppy with format a: /U The /U kept it from writing over the boot sector.. I think its this version of format.. Am I missing anything or maybe the order is wrong? This has to be in to top of the file right? VolumeLabel DB "NO NAME " ; 0x2B BytesPerSector DW ? ; 0x0B SectorsPerCluster DB ? ; 0x0D ReservedSectors DW ? ; 0x0E NumberOfFATs DB ? ; 0x10 RootEntries DW ? ; 0x11 TotalSectors DW ? ; 0x13 Media DB ? ; 0x15 SectorsPerFAT DW ? ; 0x16 SectorsPerTrack DW ? ; 0x18 HeadsPerCylinder DW ? ; 0x1A HiddenSectors DD ? ; 0x1C TotalSectorsBig DD ? ; 0x20 |
|||
30 Aug 2007, 06:49 |
|
shoorick 30 Aug 2007, 07:19
disk has to contain valid filesystem (or be formatted) before writing bootsector, otherwise it will have (if yes at all) new bootsector, but bad other structure.
do this: 1. format a: 2.copy some files to a: 3. debug - l 100 0 0 1 - w 100 0 0 1 - q 4.check files at a: this operation reads existing boot sector to ds:100 offset, and then writes it back to floppy. if it's work ok, then problem is with boot.bin . also you may check boot sector contents after reading in the range 100 - 2ff and compare with your own: - d 100 system needs only that table in boot sector (bpb?) to recognize disk, all other (FATs, root directory and file area) situated in other sectors. |
|||
30 Aug 2007, 07:19 |
|
shoorick 30 Aug 2007, 07:33
dosin wrote:
ABSOLUTELY! all your bpb fields are "?", in other words are filled with zero. should be: VolumeLabel DB "NO NAME " ; 0x2B BytesPerSector DW 512 ; 0x0B SectorsPerCluster DB 1 ; 0x0D etc... this is an example for 1.44 (constants are separate for easy modify to another floppy format, eg. 2.88, 720 or so) Code: _bs = 512 ; bytes per sector _st = 18 ; sectors per track _hd = 2 ; heads _tr = 80 ; tracks _rd = 224 ; root directory entries _ft = 2 ; fats _sf = 9 ; sectors per fat _sc = 1 ; sectors per claster org 7C00h jmp start nop db "HE-HE OS"; ; 8 BPB dw _bs ; b/s db _sc ; s/c dw _rs ; rs db _ft ; fats dw _rd ; rde dw _tr * _hd * _st ; as db 0F0h ; media dw _sf ; s/fat dw _st ; s/t dw _hd ; h dd 0 ; hs dd 0 ; -- db 0 ; drv db 0 ; -- db 29h ; ebr dd 0 ; sn db "NO NAME "; ; 11 db "FAT12 "; ; 8 start: _________________ UNICODE forever! |
|||
30 Aug 2007, 07:33 |
|
dosin 30 Aug 2007, 22:09
Ty - I have it working now!
|
|||
30 Aug 2007, 22:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.