42 #if ! ( defined ( CONSOLE_INT13 ) && CONSOLE_EXPLICIT ( CONSOLE_INT13 ) ) 44 #define CONSOLE_INT13 ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG ) 48 #define INT13CON_DRIVE 0x80 51 #define INT13CON_PARTITION_TYPE 0xe0 54 #define INT13CON_MAX_UNWRITTEN 64 63 #define INT13CON_MAGIC "iPXE LOG\n\n" 67 #define int13con_vector __use_data16 ( int13con_vector ) 71 #define int13con_buffer __use_data16 ( int13con_buffer ) 75 #define int13con_address __use_data16 ( int13con_address ) 114 "lcall *int13con_vector\n\t" )
119 DBG (
"INT13CON operation %04x failed: %02x\n",
148 ( character ==
'\n' ) ) {
153 DBG (
"INT13CON could not write log\n" );
166 int13con.disabled = 1;
196 DBG (
"INT13CON could not read MBR: %s\n",
strerror (
rc ) );
202 DBG (
"INT13CON incorrect MBR magic\n" );
203 DBG2_HDA ( 0, mbr,
sizeof ( *mbr ) );
209 for ( i = 0 ; i < (
sizeof ( part ) /
sizeof ( part[0] ) ) ; i++ ) {
217 part[i].
start ) ) != 0 ) {
218 DBG (
"INT13CON partition %d could not read header: " 225 sizeof (
hdr->magic ) ) != 0 ) {
226 DBG (
"INT13CON partition %d bad magic\n", ( i + 1 ) );
232 DBG (
"INT13CON partition %d at [%08x,%08x)\n", ( i + 1 ),
245 DBG (
"INT13CON found no log partition\n" );
257 unsigned int discard_d;
263 :
"=a" (
error ),
"=b" ( check ),
267 if (
error || ( check != 0xaa55 ) ) {
268 DBG (
"INT13CON missing extensions (%02x,%04x)\n",
276 DBG (
"INT13CON using original INT13 vector %04x:%04x\n",
284 int13con.disabled = 0;
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
struct init_fn int13con_init_fn __init_fn(INIT_CONSOLE)
INT13 console initialisation function.
#define INT13_MBR_MAGIC
MBR magic signature.
struct partition_table_entry partitions[4]
Partition table.
static uint64_t int13con_max_lba
Maximum LBA.
static void int13con_putchar(int character)
Write character to console.
#define INT13_EXTENSION_CHECK
Extensions installation check.
#define INT13CON_DRIVE
Disk drive number.
#define INT13CON_MAX_UNWRITTEN
Maximum number of outstanding unwritten characters.
struct golan_inbox_hdr hdr
Message header.
#define INT13_EXTENDED_WRITE
Extended write.
uint32_t start
Linear start address.
static uint64_t int13con_lba
Current LBA.
struct console_driver int13con __console_driver
INT13 console driver.
uint32_t type
Operating system type.
#define CONSOLE_DISABLED
Console is disabled for all uses.
An INT 13 disk address packet.
struct arbelprm_completion_with_error error
static size_t int13con_unwritten
Number of unwritten characters.
static uint8_t __bss16_array(int13con_buffer, [INT13_BLKSIZE])
Sector buffer.
#define ENOENT
No such file or directory.
unsigned long long uint64_t
#define INT13_BLKSIZE
Block size for non-extended INT 13 calls.
static size_t int13con_offset
Current offset within sector.
static struct segoff __bss16(int13con_vector)
Original INT13 vector.
uint32_t start
Starting offset.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
An initialisation function.
void(* putchar)(int character)
Write a character to the console.
#define INT13CON_MAGIC
Log partition magic signature.
char * strerror(int errno)
Retrieve string representation of error number.
static void int13con_init(void)
Initialise INT13 console.
uint32_t length
Linear length.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
uint64_t lba
Starting block number.
#define INIT_CONSOLE
Console initialisation.
static uint16_t struct vmbus_xfer_pages_operations * op
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
static int int13con_rw(unsigned int op, uint64_t lba)
Read/write disk sector.
#define __from_data16(pointer)
#define EIO
Input/output error.
#define INT13CON_PARTITION_TYPE
Log partition type.
#define INT13_EXTENDED_READ
Extended read.
#define DBG(...)
Print a debugging message.
A partition table entry within the MBR.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define REAL_CODE(asm_code_str)
uint16_t magic
0x55aa MBR signature
void * memset(void *dest, int character, size_t len) __nonnull
static int int13con_find(void)
Find log partition.