Lines Matching +full:read +full:- +full:to +full:- +full:read
50 * written into our xread routine, we'll define a BPB to work around it.
51 * The data marked with (T) indicates a field required for a ThinkPad to
56 * Note: If additional space is needed in boot1, one solution would be to
57 * move the "prompt" message data (below) to replace the OEM ID.
81 * Trampoline used by boot2 to call read to read data from the disk via
84 * %cx:%ax - long - LBA to read in
85 * %es:(%bx) - caddr_t - buffer to read data into
86 * %dl - byte - drive to read from
87 * %dh - byte - num sectors to read
93 * Setup an EDD disk packet and pass it to read
102 movb %dh,%al # blocks to
106 callw read # Read from disk
108 lret # To far caller
110 * Load the rest of boot2 and BTX up, copy the parts to the right locations,
115 * Setup the segment registers to flat addressing (segment 0) and setup the
116 * stack to end just below the start of our code.
125 * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets
138 * FreeBSD slice. We use the fake partition entry below that points to
140 * FreeBSD slice. The second pass looks for the first non-active FreeBSD
147 callw nread # Read MBR
173 * Ok, we have a slice and drive in %dx now, so use that to locate and load
176 * we read it in, we conveniently use 0x8c00 as our transfer buffer. Thus,
181 * BTX, so we have to figure out where the start of it is and then move the
182 * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, but
183 * when we use btxld to create boot2, we use an entry point of 0x2000. That
184 * entry point is relative to MEM_USR; thus boot2.bin starts at 0xc000.
188 callw nread # Read disk
191 add %bx,%si # %si to start of boot2.bin
193 mov $MEM_BTX+(NSECT-1)*SIZ_SEC,%cx # Byte
200 * Use the zero-valued %cx as a timeout for embedded hardware which do not
218 jmp start+MEM_JMP-MEM_ORG # Start BTX
222 * Trampoline used to call read from within boot1.
227 push %cs # Read from
231 # message and fall through to
234 * Print out the error message pointed to by %ds:(%si) followed
245 * Display a null-terminated string using the BIOS output.
255 * Overused return code. ereturn is used to return an error from the
256 * read function. Since we assume putstr succeeds, we (ab)use the
261 return: retw # To caller
265 * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to
269 * %dl - byte - drive number
270 * stack - 10 bytes - EDD Packet
272 read: testb $FL_PACKET,%cs:MEM_REL+flags-start # LBA support enabled? label
273 jz read.1 # No, use CHS
275 jb read.1 # No, use CHS
281 jc read.1 # If error, use CHS
283 jne read.1 # No, so use CHS
285 jz read.1 # No, so use CHS
288 int $0x13 # read
289 retw # To caller
290 read.1: push %dx # Save
321 mov 0x2(%bp),%ah # Blocks to read
322 cmpb %ah,%al # To read
323 jb read.2 # this
329 read.2: mov $0x5,%di # Try count
330 read.3: les 0x4(%bp),%bx # Transfer buffer
332 movb $0x2,%ah # BIOS: Read
335 jnc read.4 # If success
337 jz read.6 # No
341 jmp read.3 # Continue
342 read.4: movzbw %bl,%ax # Sectors read
344 jnc read.5 # LBA,
346 read.5: shlb %bl # buffer
349 ja read.1 # If not done
350 read.6: retw # To caller
354 msg_read: .asciz "Read"