flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > MiniDOS Bootsector Question(s) |
Author |
|
rhyno_dagreat 04 May 2007, 15:36
Also, I'm wondering "Wouldn't you load 512 into bpbBytesPerSector?" Because I see it still set as 0 in the code. :confused:
|
|||
04 May 2007, 15:36 |
|
LocoDelAssembly 04 May 2007, 15:45
1) The CPU calculates the effective address as [segment * 16 + offset].
2) Not sure, 4 KB? 3) A paragraph is 16 bytes. 4) Logical Block Addressing. Instead of using the CHS (cylinder, head, sector) addressing you just specify a sector number. I haven't got the MiniDOS sources so I don't know its exact use, here Dex must reply. |
|||
04 May 2007, 15:45 |
|
rhyno_dagreat 04 May 2007, 16:01
Thanks for the help that you gave, Loco. Stuff is starting to make the slightest bit of sense. =-) (kinda helps when you know the terminology used)
|
|||
04 May 2007, 16:01 |
|
Dex4u 04 May 2007, 19:59
First MiniDos uses fat12 and here's some answers to your ?.
1. The first thing it does on booting, is move it's self to top of Conventional Memory, it does this by doing a int 12h to find how much Conventional Memory is on the sys. Code: int 12h ; get conventional memory size (in KBs) shl ax, 6 ; and convert it to paragraphs Then it converts it to paragraphs, then we sub size of boot sector (512bytes) and move the size of conventional memory -512 into es, then we sub 2048 bytes from ax for the stack and move it into ss, so ss = top of Conventional Memory -512-2048, then we set sp to 2048 for top of stack (search for how stacks work). Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Reserve some memory for the boot sector and the stack ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sub ax, 512 / 16 ; reserve 512 bytes for the boot sector code mov es, ax ; es:0 -> top - 512 sub ax, 2048 / 16 ; reserve 2048 bytes for the stack mov ss, ax ; ss:0 -> top - 512 - 2048 mov sp, 2048 ; 2048 bytes for the stack Then we move the boot sector from 7C00h to top of conventional memory -512. Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copy ourself to top of memory ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov cx, 256 mov si, 7C00h xor di, di mov ds, di rep movsw;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Jump to relocated code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2. A cluster is group of sectors, that the sys treats as a unit of storage space.Theres no standared size for a cluster, but for a fat12 1.44 floppy, it would be 512bytes or 1 sector ( a sector =512byte), but for fat16/32 it could be any number of sectors, but its always a power of 2, such as 1, 2, 4, 8 etc sectors. 3. paragraphs = 16 bytes 4. See here : http://en.wikipedia.org/wiki/Logical_block_addressing PS @LocoDelAssembly, I took it off my site as i did not think anyone downloaded it anymore, also note: MiniDos is load by "bootprog" a com/exe file loader. |
|||
04 May 2007, 19:59 |
|
rhyno_dagreat 05 May 2007, 02:58
Thanks, Dex. I was starting to make some sense of it after Loco explained to me a few terms, yet that sorta topped it off by giving me a more in-depth explaination of how it works. Also, I mainly know of the stack as an area set up in memory which you can temporarily store variables on in the FILO method (First In Last Out).
Thanks again! |
|||
05 May 2007, 02:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.