[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Bootcode
hello!
about the kernel bootsect.S code :
1. check tigran's linux kernel-2.4 internals at:
http://www.moses.uklinux.net/patches/lki.html
2. your specific question i think is about the movb $36.... this is to
allow multi-sector reads instead of `slower` single sector reads. 36 i think
refers to max. sector count.
3. i have pasted below the relevant lines from the doc for reference which
makes it clear. your specific query might be line no 101.
Vikram
----
Lines 77-103 patch the disk parameter table for the first disk to
allow multi-sector reads:
______________________________________________________________
77 # Many BIOS's default disk parameter tables will not recognise
78 # multi-sector reads beyond the maximum sector number specified
79 # in the default diskette parameter tables - this may mean 7
80 # sectors in some cases.
81 #
82 # Since single sector reads are slow and out of the question,
83 # we must take care of this by creating new parameter tables
84 # (for the first disk) in RAM. We will set the maximum sector
85 # count to 36 - the most we will encounter on an ED 2.88.
86 #
87 # High doesn't hurt. Low does.
88 #
89 # Segments are as follows: ds = es = ss = cs - INITSEG, fs = 0,
90 # and gs is unused.
91 movw %cx, %fs # set fs to 0
92 movw $0x78, %bx # fs:bx is parameter table
address
93 pushw %ds
94 ldsw %fs:(%bx), %si # ds:si is source
95 movb $6, %cl # copy 12 bytes
96 pushw %di # di = 0x4000-12.
97 rep # don't need cld -> done on
line 66
98 movsw
99 popw %di
100 popw %ds
101 movb $36, 0x4(%di) # patch sector count
102 movw %di, %fs:(%bx)
103 movw %es, %fs:2(%bx)
----