flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Simple Booter Questions Goto page 1, 2, 3 Next |
Author |
|
revolution 28 Mar 2008, 19:08
AlexP: There is a wealth of info on this very board about bootloaders, booting from floppy, booting from HDD, booting from USB, booting from CD, entering PM, entering FRM etc. All the answers are waiting for you, I encourage you to seek and guarantee you will find it in abundance.
|
|||
28 Mar 2008, 19:08 |
|
edfed 28 Mar 2008, 19:09
if your machine support the boot from usb pens, then, you can use them as floppies. with int13h. or boot from the usb floppy as well.
|
|||
28 Mar 2008, 19:09 |
|
AlexP 28 Mar 2008, 19:16
I didn't know that you could have boot code on a flash drive, mine has a FAT file system, that is all I can tell about it. So how do I get the booter onto the base of the drive? And can I use Windows to place files in the root directory?
|
|||
28 Mar 2008, 19:16 |
|
edfed 28 Mar 2008, 19:31
all depends on the code on the bootloader.
if your boot loader support a file system, then, yes, if not, you can use only your stuff to put files on the drive. the file system have it's root in the boot sector. the first sector of the root is pointed by a dword in the mbr. then, if your mbr don't have a structure compatible with win$ file systems, it will act as a virus on your drive (cf my stupid manipulation of this night). |
|||
28 Mar 2008, 19:31 |
|
AlexP 28 Mar 2008, 19:43
I will use my own file system, all it will be is a piece of 32-bit code that I would like to execute ( on my spare CPU hours ).
Is it possible to use some sort of Windows tool too wipe the USB drive, write the bootloader to it, and then place binaries onto the USB after the boot code? That would be the preferred method for me, but I do not know of any tool to do it. Does anyone here know one? |
|||
28 Mar 2008, 19:43 |
|
edfed 28 Mar 2008, 19:59
you can write a tool with windows api to write on sectors.
after, if you use the int13h to read at boot time, i invite you to make it with a lba localisation of sectors. the idea to optimise the file system function of the geometry is a bullshit as the geometry is variable, and there are less sectors per physical tracks in the center of the drive than on the periphery. the chs geometry is not the same as the real geometry. does your file system support files up to 4G sectors? and will it support lfn? and etc... ? if you want we can start to code it in team. just because alone, it's boring. |
|||
28 Mar 2008, 19:59 |
|
AlexP 28 Mar 2008, 20:09
Quote: if you want we can start to code it in team. just because alone, it's boring. [edit]: Which Win32 API would you call to wipe a flash drive? I don't know the structure of one internally, but I could probably find out. |
|||
28 Mar 2008, 20:09 |
|
edfed 28 Mar 2008, 21:37
i don't code for win.
i don't go to irc, cauz it's not free for windows, then, only this place is available. |
|||
28 Mar 2008, 21:37 |
|
AlexP 28 Mar 2008, 22:02
Does anyone know how to use Bochs under Windows? I don't want to start a new thread just to ask... It never works for me, I can't figure out how to make it load my .bin file.
|
|||
28 Mar 2008, 22:02 |
|
edfed 28 Mar 2008, 22:39
xchat is not free after 30 days of free eval.
for bochs, it's simple, you simply put a times 1474560-($-$$)-512 db 0 at the end of the file. then compile, and you have a .bin ready to use in bochs. - 512 for the boot sector at the start of the file in case of redifinition of org. Code: org 7c00h boot sector rb 510-($-$$) dw 0aa55h org xxxx kernel times 1474560-($-$$)-512 db 0 then: run bochs configure bochs : 3 enter disk options : 10 enter floppy 1: 1 enter floppy name = file.bin floppy type = 1.44M inserted save to config.config run that's all if you run xp, you can use virtual pc, it's a bit better.. |
|||
28 Mar 2008, 22:39 |
|
AlexP 28 Mar 2008, 22:59
VirtualPC doesn't run on my Vista OS (I got a friendly message when I tried it yesterday), I'll try out that Bochs like it says, and I will post if it works. THanks
[edit]: I love you. (in a manly way) *? Now I can play with it, and figure out what protected mode is . I will most likely need help, please post links to protected mode sources if you have them! |
|||
28 Mar 2008, 22:59 |
|
edfed 28 Mar 2008, 23:19
i let you seek.
for exemple, the source for fab it is a project to boot, and 1 second later, show xhtml then it can be concidered as an os the pm switch is from dex.. and it is very powerfull, you can return to rm, rereturn to pm as you want.. not an edit: did you seek in existing threads? because as stated revolution, there are a lot of examples on this forum. a lot, a lot, alot, a lot ..... this is an edit: seek in a thread named int 13h, starter was rhyno dagreat. it is full of many little pm switchers. |
|||
28 Mar 2008, 23:19 |
|
AlexP 28 Mar 2008, 23:32
I've gone through several pages reading all the threads in this section , but I was mostly half-asleep (oxymoron?). So, I'll re-read what I have to. I do have one question, are the parameters for int 0x13 the same for a USB memory read? And I still need to get the thing wiped and written to... I'll find something, but for now I'll try Bochs.
|
|||
28 Mar 2008, 23:32 |
|
edfed 29 Mar 2008, 00:19
the best it to try.
|
|||
29 Mar 2008, 00:19 |
|
AlexP 29 Mar 2008, 01:24
Why the small font? And I just bought a little USB for me to try with, "Attache PNY, 1 GB". I'll have fun, I just hope that the BIOS is able to boot from it... If anyone has any advice to give WHATSOEVER about using USB for any programming, PLEASE TELL MEEEE!!!!. I should be able to get it working eventually though....
[update]: I'm using "dd" software, I just tested my new USB by doing a full copy of it to my HDD, the program appears to be working and I'll try writing to the boot sector. [update2]: I copied the boot sector of the USB to a file on my disk, got a nice little hex editor, and found 0x55aa, so I know what I must do.. <triumphant voice> |
|||
29 Mar 2008, 01:24 |
|
AlexP 29 Mar 2008, 02:57
Okay, I heard that if you write to a USB (raw data copy), then that becomes the size of the USB drive from now on... Source;
http://www.bootdisk.com/pendrive.htm I think it's only for Windows, so it shouldn't affect me, but if I'm wrong then I'm screwed. |
|||
29 Mar 2008, 02:57 |
|
revolution 29 Mar 2008, 03:06
Looks like you answered all your own questions. Learning is the best way to stay happy.
|
|||
29 Mar 2008, 03:06 |
|
AlexP 29 Mar 2008, 03:24
I just got a BIOS error when trying to boot from my USB bootloader code, it said "No bootable partiton in table". Yes, it's spelled wrong.
1) It's a just-bought USB flash drive, FAT file system (now unusable drive?) 2) The bootloader code is OK, it works on Bochs and only consists of a "jmp $" 3) I used the 'dd' software to write directly to the first 512 bytes of the USB stick, and I double checked by importing the same memory and loading it into a hex viewer, it's fine (with 55aa) Is this the proper way to write bootloader code to a flash drive? I do not know why the BIOS is giving me that error, or what the error means. BTW, Windows says it needs to be formatted before using it (of course), but when I check the "properties" tab it shows 0 bytes for everything. |
|||
29 Mar 2008, 03:24 |
|
revolution 29 Mar 2008, 05:53
Your BIOS might be checking for the first 3-byte jump instruction. Try "jmp word $".
|
|||
29 Mar 2008, 05:53 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.