flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Floppy Disk Help

Author
Thread Post new topic Reply to topic
Jakevfr



Joined: 03 Feb 2007
Posts: 26
Jakevfr
Alright, I'm following a simple little tutorial on making a little OS and I've hit a major problem; whenever I try to run my OS I get this:
Quote:

Invalid system file
Reload disk and press any key to try again

I've created my .bin files and copied them to a floppy but it won't work and I haven't been able to find a topic that tells me how to fix this (although I now know a heck of a lot more about floppys after all the topics I've looked through Razz)
Post 13 Feb 2007, 03:16
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
We need more info, like code for bin, what you used to write .bin file to floppy etc.
Eg: is your bin file 512 bytes in size, with something like this at the end ?
Code:
times 510- ($-start)  db 0
dw 0xaa55
    
Post 13 Feb 2007, 16:14
View user's profile Send private message Reply with quote
Jakevfr



Joined: 03 Feb 2007
Posts: 26
Jakevfr
Here's the code I'm trying (It's in NASM format because the tutorial I'm following uses NASM)
Code:
push word 0b800h
pop es
xor di, di
mov [es:di], word 441h

jmp $

times 510 - ($ - $$) db 0
db 55h
db 0aah    

Thanks
Post 13 Feb 2007, 17:29
View user's profile Send private message Reply with quote
Jakevfr



Joined: 03 Feb 2007
Posts: 26
Jakevfr
Sorry for the double post, but I just got it to work. It turns out I was comiling it wrong. Thanks for your help
Post 13 Feb 2007, 19:15
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Just in case more examples:
example1
C:\FASM TEST.ASM TEST.BIN
put it on a floppy with rawrite.
Code:
 org 0x7C00use16;****************************; Realmode startup code.;****************************start:        xor   ax,ax        mov   ds,ax        mov   es,ax        mov   ss,ax        mov   sp,0x7C00;*************************************; Print message.;*************************************       mov ax,0xB800       mov es,ax       lea si,[msg0]       mov di,(80 * 1 + 2) * 2       mov cx,26       cld       rep movsb            jmp  $ msg0 db "  H E L L O   W O R L D !   "      ;*************************************; Make program 510 byte's + 0xaa55;*************************************times 510- ($-start)  db 0dw 0xaa55     


example2
With bios.
C:\FASM TEST.ASM TEST.BIN
put it on a floppy with rawrite.
Code:
 org 0x7C00use16;****************************; Realmode startup code.;****************************start:        xor   ax,ax        mov   ds,ax        mov   es,ax        mov   ss,ax        mov   sp,0x7C00;*************************************; Print message.;*************************************        mov  si,msg0        call  print        jmp  $;====================================================;;  print.                                            ;;====================================================;print:        mov   ah,0Eh                       ; Request displayagain1:        lodsb                              ; load a byte into AL from DS:SI        or   al,al                         ; Or AL        jz   done1                         ; Jump 0, to label done1        int  10h                           ; Call interrupt service        jmp  again1                        ; Jump to label again1done1:        ret                                ; Return msg0 db " Hello world! "      ;*************************************; Make program 510 byte's + 0xaa55;*************************************times 510- ($-start)  db 0dw 0xaa55     
Post 13 Feb 2007, 19:21
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
Maybe my boot sector example could help you in some way?


http://board.flatassembler.net/topic.php?t=6529


Regards,
Mac2004
Post 14 Feb 2007, 16:57
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.