1 /* ----------------------------------------------------------------------- *
3 * Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
4 * Copyright 2009 Intel Corporation; author: H. Peter Anvin
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 * Boston MA 02111-1307, USA; either version 2 of the License, or
10 * (at your option) any later version; incorporated herein by reference.
12 * ----------------------------------------------------------------------- */
15 * int 0x25 and 0x26 direct sector access
17 * Use assembly wrapper functions for these system calls, since unlike
18 * int 0x21 calls they are "dirty" and can destroy unrelated registers.
20 * NOTE: these all assume the data buffer is in the data segment, i.e.
21 * %ds == %es == dio.bufseg.
23 * Usage: int int25_read_sector(drive, dio)
24 * Usage: int int26_write_sector(drive, dio)
30 .globl int25_read_sector
31 .type int25_read_sector, @function
38 decw %ax /* AL = drive number (0 = A:) */
39 movw %dx, %bx /* BX = dio structure */
40 movw 6(%bx), %dx /* DX = data buffer */
44 xorw %ax, %ax /* Error code: 0 = no error */
53 .size int25_read_sector, .-int25_read_sector
55 .globl int26_write_sector
56 .type int26_write_sector, @function
63 decw %ax /* AL = drive number (0 = A:) */
64 movw %dx, %bx /* BX = dio structure */
65 movw 6(%bx), %dx /* DX = data buffer */
69 xorw %ax, %ax /* Error code: 0 = no error */
78 .size int26_write_sector, .-int26_write_sector