flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > bootloader information |
Author |
|
GhostXoPCorp 31 Dec 2009, 05:38
i am at a friends house who doesnt have a virtual machine and i need someone to tell me if this works
|
|||
31 Dec 2009, 05:38 |
|
sinsi 31 Dec 2009, 05:49
If your bootloader is at track 1, sector 1, head 1 on drive A then...no it still won't work.
Code: push cs
pop es
mov bx,databuf Sectors are numbered starting from 1 but tracks/heads start from 0 |
|||
31 Dec 2009, 05:49 |
|
GhostXoPCorp 31 Dec 2009, 05:55
org 100h
mov ah, 02h mov al, 1 ;just the bootloader mov ch, 0 mov cl, 0 mov dh, 0 mov dl, 00h push cs pop es mov bx, databuf ;;;;;;;do i add a pop cs here? ret databuf: times 512 db 0 |
|||
31 Dec 2009, 05:55 |
|
sinsi 31 Dec 2009, 05:57
>do i add a pop cs here
No, maybe an int 13h Sectors are numbered starting from 1 |
|||
31 Dec 2009, 05:57 |
|
GhostXoPCorp 31 Dec 2009, 06:00
org 100h
mov ah, 02h mov al, 1 ;just the bootloader mov ch, 0 mov cl, 1 mov dh, 0 mov dl, 00h push cs pop es mov bx, databuf int 13h ret databuf: times 512 db 0 |
|||
31 Dec 2009, 06:00 |
|
sinsi 31 Dec 2009, 06:16
Code: mov cl,1 ;to read the first sector (bootsector) You are running this from DOS? With a .com file? |
|||
31 Dec 2009, 06:16 |
|
GhostXoPCorp 31 Dec 2009, 06:31
yea i need a way to get information about the disk my user puts into the drive and tell whether is fat12 or not, and this example with help me know how to, but my os isnt in working condition right now, so i use this example to use in my os, but for now it is a stand alone file that will load the boot sector and print its contents on the screen, for ow i just need to load the first 512 bytes or the disk. i do plan on running this on dos, im not using the dos disk handlers because when this works, ill just copy the function into my os, without having to change the ints used because they are bios, or standalone
|
|||
31 Dec 2009, 06:31 |
|
sinsi 31 Dec 2009, 06:56
Look for info about the BPB (BIOS Parameter Block), which is in the boot sector of a DOS-formatted floppy.
|
|||
31 Dec 2009, 06:56 |
|
GhostXoPCorp 31 Dec 2009, 07:15
i have that already, but thank u, it wont be a dos formatted floppy tho, i just need to load the bootloader into the buffer, and il have the info i need and manipulate it from wat i need
|
|||
31 Dec 2009, 07:15 |
|
GhostXoPCorp 31 Dec 2009, 07:20
so a side question, if i want to put information in say es:ax
all i have to do is push cs pop es mov ax, buffer? and from there i can put more code to execute or after putting data into es:ax i have to pop cs in order to continue? |
|||
31 Dec 2009, 07:20 |
|
revolution 31 Dec 2009, 07:21
You can't pop cs.
|
|||
31 Dec 2009, 07:21 |
|
GhostXoPCorp 31 Dec 2009, 07:26
oh ok thanks, i dont use push or pop alot
_________________ Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me. |
|||
31 Dec 2009, 07:26 |
|
sinsi 31 Dec 2009, 07:30
>You can't pop cs.
heh, unless it's an 8088/8086 Forget the 'pop cs' since the push cs/pop es balance. You load your second stage wherever you want and jump to there...easy. Usually after you read it you push es and bx then do a far return, since es:bx is used by int 13h. |
|||
31 Dec 2009, 07:30 |
|
revolution 31 Dec 2009, 07:34
Anyway, who uses floppies anymore? If the machine is old enough to actually have a floppy drive then perhaps is really is an 8088/8086
|
|||
31 Dec 2009, 07:34 |
|
GhostXoPCorp 31 Dec 2009, 07:39
lol its my file system in my real mode os
|
|||
31 Dec 2009, 07:39 |
|
sinsi 31 Dec 2009, 07:44
>Anyway, who uses floppies anymore?
VMs, XP with SATA, us 'os construction' people. An FDC/FDD is one learning point for a PM OS - learning all of the ins and outs of I/O. |
|||
31 Dec 2009, 07:44 |
|
bitshifter 31 Dec 2009, 17:35
Yeah, hehe, i take the FD out of my old PC's and put in new PC's
|
|||
31 Dec 2009, 17:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.