Hi fellaz! I have basic knowledge of assembler. I need to make a boot sector or eventually boot sector and boot loader. I just want to put the sector on a floppy and when my computer starts just to load it in the memory and then load the mbr of my hdd or the boot sector of my active partition and start windows. Is it possible and if yes how? Thanks in advance!



:manchev
Posted on 2003-05-13 18:51:05 by manchev
This is really a question for the heap.

There are several boot sectors on the web for different purposes.

A quick Google for "boot sector MBR source code" came up with many valuable links:

http://www.singlix.com/trdos/specs.html
Posted on 2003-05-13 21:14:13 by bitRAKE
Thanks for the link but I have all these sources and it doesnt help. If here is a real guru in low level system programming let him show up! Thanks again!



:manchev
Posted on 2003-05-14 04:23:18 by manchev
Posted on 2003-05-14 04:38:17 by Guerrilla
there are so many bootloader examples.

what is the problem?
- assembling of the boot code
- accessing the HD via port or Int13
- reading the partition table
- writing the bootsector to disk

Bye Miracle
Posted on 2003-05-15 06:54:02 by miracle
And here you go: I've got the major part of the boot sector source, but the problem is that I don't know how to go to the boot sector of the given partition, load it and execute it. I don't know how to access it. That's it! But if you can give me a more complete info about this problem I'll be very greatful! Thanks in advance miracle, you're a whole miracle! ;)
Posted on 2003-05-15 20:19:50 by manchev
Posted on 2003-05-15 21:09:27 by bitRAKE
Hi,

here we go, I recommend the following procedure:

scenario: booting from floppy, read MBR of hard drive, check partition tables, print
partition info, boot partition previously choosen.

similar to LILO and GRUB

1. write your own bootblock for floppy
since there are only 510 bytes for your code it is a good idea to load the next 8 sectors
4Kbyte with the code which does the job.

this is similar to Bogdans SolarOS link and
the boot loader from Linus Torvald Linux 0.0.1

load this code to 0000:7E00 for exmple

2. read the MBR from hard drive

3. refer to offset 01BEh, which contains the first partition

4. refer to 1CEh, 1DEh and 1EEh respectively

5. print the information gathered from partition table

6. let the user make a choice

7. load from the partitions location CHS and load the first sector of partition to
to 0000:7C00 and jump there

8. ready

ALL the information needed is available here

Bye Miracle
Posted on 2003-05-16 06:40:56 by miracle
bitRAKE, miracle, you're wonderfull! Thank you! This helps me a lot!!!;)



:manchev
Posted on 2003-05-17 06:42:12 by manchev
Just click my 'WWW' link the boot kernel loader is working, but the Kernel it self are not.
Posted on 2003-05-17 08:01:45 by realvampire
realvampire, do you realize what are we talking about? we're discussing a boot sector program and there is nothing like it on your site. plese, be more concrete...



:manchev
Posted on 2003-05-17 12:17:28 by manchev
Manchev, its inside my Package. BTW I upload it here.


Note: Can someone hacking it using my compiler? Where is my hero ?
Posted on 2003-05-18 18:00:58 by realvampire
Any other ideas or some lines of code, miracle? I like your solution but some parts are a bit complicated for me so can you give some kind of source, just some lines? Thank you again, miracle!



:manchev
Posted on 2003-05-20 09:51:17 by manchev
which parts?

Bye Miracle
Posted on 2003-05-21 04:42:07 by miracle
maybe the code that should move the current code loaded in 0x0000:0x7c00 so the mbr can be loaded there. got it? thanks!



:manchev
Posted on 2003-05-23 11:33:29 by manchev
I just want to put the sector on a floppy and when my computer starts just to load it in the memory and then load the mbr of my hdd or the boot sector of my active partition and start windows. Is it possible and if yes how? Thanks in advance!

I just want to put the sector on a floppy =use rawrite or debug =)
starts just to load it in the memory and then load the mbr of my hdd or the boot sector of my active partition and start windows =its already done alot of times.. i think theres source?s on simtel.net name is something like bootthru i think..
good luck!//rygar
Posted on 2003-05-26 19:00:57 by Rygar
here's the code that works:

-- ---------------------------------




cli
mov ax,0x9000
mov ss,ax
mov sp,0xffff
sti

mov ax,0x07c0
mov ds,ax
mov es,ax
cld

mov si,0
mov di,0200h
mov cx,0200h
repz movsb
jmp read + 200h

read:
mov ah,02h
mov al,01h
mov ch,00h
mov cl,01h
mov dh,00h
mov dl,80h
mov bx,0x0000
mov es,bx
mov bx,0x7C00
int 13h

jmp 0x0000:0x7C00

times 510-($-$$) db 0
dw 0AA55h

-----------------------------------

thanks to all, especially Rygar! best regards,

:manchev
Posted on 2003-05-27 12:52:47 by manchev