flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Simple Booter Questions

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 30 Mar 2008, 21:22
Yes, my USB is recognized by the BIOS in the BOOT MENU, I'll try again with the write, and did you format your 64 Mb drive beforehand? I guess it doesn't matter, I'll try it again right now.

[edit]: I used DD and wrote to the flash drive ( 1 Gb drive) just like you did, and upon booting my system with only "USB Flash" enabled, it gave me an "Operating System Not Found" error. It also gives me this error when I don't have anything to boot from, so I don't know if it means the partition table worked but the code section failed, or if it just didn't recognize it. Thanks for help,

I bought a few CD's hoping those would work, could anybody tell me if they are even bootable? The only option is "Internal Optical Drive' that sounds like it in the BIOS.
Post 30 Mar 2008, 21:22
View user's profile Send private message Visit poster's website Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 295
Alphonso 31 Mar 2008, 11:36
Well I had a look around the web and the only reason I could see that PeToUSB would not find your USB flash on Vista is if it wasn't run under Administrator / elevated priviledges, something to do with UAC perhaps. Maybe someone else with Vista would be kind enough to confirm.

Something is not right and I think you need to get at least a known working bootable USB flash to work on your machine first. I can update the code for you to show if it's booting from boot sector or MBR but with that message it sounds like it's not recognising the flash as bootable at all.
Code:
ORG 7c00h
        mov ax,cs
        mov ds,ax
        mov es,ax
        mov cx,MBRMessL
        mov si,MBRMess
        mov ah,0eh
@@:     lodsb
        int 10h
        dec cx
        jnz @b
        mov ah,0
        int 16h
        int 19h

MBRMess db 0dh,0ah,'MBR Boot Loader',0dh,0ah
MBRMessL=$-MBRMess

times 1beh-($-$$) db 0     ;Pad to first table

        db 80h             ;Active at 1BE
        db 1               ;Start head
        dw 1               ;Start Cyl 0, Sec 1
        db 06h             ;File System
        db 254             ;End Head
        dw 063fh           ;End Cyl 6, Sec 63
        dd 3fh             ;63 Sectors before
        dd 128000-63       ;number of sectors
                           ;Size is 64M
times 510-($-$$) db 0      ;Pad to signature
        dw 0AA55h          ;Signature at 1FE

times 62*512 db 0          ;pad 62 more sectors

org 7c00h                  ;Boot Sector
        jmp short Start
        nop
OEM:
        db 'AES'
times 8-($-OEM) db 20h
        dw 512             ;Bytes/sect
        db 4               ;Sect/cluster
        dw 1               ;Reserved Sectors
        db 2               ;Fattys
        dw 512             ;Rootys
        dw 0               ;few sectors
        db 0f8h            ;Media type
        dw 125             ;Sect/Fat
        dw 63              ;Sect/track
        dw 255             ;Heads
        dd 63              ;Sectors before
        dd 128000-63       ;lots of sectors
        db 80h             ;Drive No.
        db 0               ;Dirty
        db 29h             ;Sig
        dd 0               ;SNo.
VLab:
        db 'AES'           ;Label
times 11-($-VLab) db 20h
FSType: db 'FAT16'         ;File system type
times 8-($-FSType) db 20h
        dd 0,0             ;Reserved
Start:
        mov ax,cs
        mov ds,ax
        mov es,ax
        mov cx,MessL
        mov si,Mess
        mov ah,0eh
@@:     lodsb
        int 10h
        dec cx
        jnz @b
        mov ah,0
        int 16h
        int 19h

Mess    db 0dh,0ah,'USB Boot Sector',0dh,0ah
MessL=$-Mess
times 510-($-$$) db 0      ;Pad to Sig
        dw 0AA55h          ;Signature
    
Alex, would you check the USB has been written too by reading back from the USB device to a file, something like
Code:
dd if=\\?\Device\Harddisk1\Partition0 of=check.bin bs=32k count=1    
Where Harddisk1 would be replaced with your USB Harddisk number. Thanks.
Post 31 Mar 2008, 11:36
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 31 Mar 2008, 12:53
Every time I write to the USB I import it back to a file to check, and I double-check by opening up the flash drive with 'hex workshop'. I know it is not writing to the USB that is the problem, and with Vista I've always had weird problems with Administrator. Sometimes it says I have it, but others it says I do not have the privilege?! I'll continue to look around for an actual bootable one like you said, there has to be something online. Thanks again, and do you (anybody?) know if I could simply use a bootable CD, I think it would be easier.
Post 31 Mar 2008, 12:53
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 31 Mar 2008, 13:00
Bootable CD's should be easy, they have a 2k sector size. And there is already an example on this board somewhere, I remember seeing it a few years back. Perhaps searching something like Joliet will yield some results?

Search grasshopper, it is the path to treasure of untold riches.
Post 31 Mar 2008, 13:00
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 31 Mar 2008, 13:04
Oh here it is, I did your search for ya:

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

your welcome
Post 31 Mar 2008, 13:04
View user's profile Send private message Visit poster's website Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 31 Mar 2008, 13:35
Thanks!

I'll burn to CD and try out with a little int 0x13.
Post 31 Mar 2008, 13:35
View user's profile Send private message Visit poster's website Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 295
Alphonso 31 Mar 2008, 14:13
Optical I would imagine covers blueray, HD, DVD CD or any drive that uses optics (laser)
Guessing with the Vista stuff, it would appear being logged in as Administrator does not mean programs will be run privileged. You might have to configure DD, PeToUSB & PTEDIT as per here

Hope this helps, if not I am at a loss as to why those programs don't work for you.
Post 31 Mar 2008, 14:13
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 31 Mar 2008, 14:27
I'll try it out when I get home, now I am in school... It should be a lot of fun when it actually gets to work, and I didn't think that a CD had so much on it, nevermind the bootloader and kernel. After I get something to boot (hopefully), I'll start learning 16-bit programming and work on it. I'd imagine that int 0x13 will cover loading bytes from the CD into memory, I'll have to check that out. Thanks again Alphonso!
Post 31 Mar 2008, 14:27
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 31 Mar 2008, 17:30
For making a bootable CD, you simply, first make a bootable floppy image, then you go into your burn software and click make project bootable or something like that, it asks you for a bootable image point it to the floppy one you made.
It will add 2 .bin file to the CD and now the CD is bootable.
Once burnt, you can add other stuff to the CD, but you can only get at whats on the floppy image (from realmode), without writing a atapi driver.
Post 31 Mar 2008, 17:30
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 31 Mar 2008, 23:26
Thank you, but can I also use the CD bootcode that Revolution gave me a link to? And by a bootable floppy image I'm guessing you mean a simple 512 byte bootloader, right? Just the jump, the code, and then the signature? I'll try it, but I don't have any burning software... I'll find something online. Maybe Windows Media Player will work?...

[edit]: WMP does not work, I'll get NERO (I found tutorial online)

[edit2]: If I get the darn thing booted, I'll just use realmode to load the file into memory. I'll make some sort of a file format for the OS (like length/name appended or something) so I can figure it out at runtime. I did see that I can just use FASM's 'file' directive to organize all of my code into several source files, like:
Code:

; bootloader code

file 'kernel.bin'
file 'api.bin'
file 'monkeys.bin' ; just in case...
    


Sorry to say I'm taking a little time off from this to work on the project at hand, I tired REvolution's juliet but my burning software just wasted 2 CD's trying to get it to burn the entire code, apparently 'align 2048' wasn't the way to do it.
Post 31 Mar 2008, 23:26
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 16 Apr 2008, 17:41
look at this.
maybe it is the reason why normal BPT don't work using flash drives.
Post 16 Apr 2008, 17:41
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.