6 # move stack to the top of 512k
10 # use the code segment for data access
19 mov $_boot2_size, %eax
22 # load the second stage boot loader and jump to it
23 mov $_boot2_size, %eax
31 # set es to the start of the destination buffer to allow reading in
43 .set SECT_PER_TRACK, 18
48 # read_sect(first, num)
53 mov ARG_SIDX(%bp), %ax
54 mov ARG_NSECT(%bp), %cx
60 1: cmp ARG_NSECT(%bp), %cx
73 # calculate the track (sidx / sectors_per_track)
76 mov $SECT_PER_TRACK, %cx
79 # save the remainder in ax
84 # cylinder (track/2) in ch [0-7] and cl[6,7]<-[8,9]
88 # sector num cl[0-5] is sidx % sectors_per_track (saved in ax)
91 # ah = 2 (read), al = 1 sectors
93 movb drive_number, %dl
96 # increment es:bx accordingly (advance es if bx overflows)
119 # expects number in eax
137 # print the backwards string
156 drive_number: .byte 0