mirror of
https://github.com/grub4dos/ntloader.git
synced 2025-05-08 19:51:14 +08:00
enable IF eflag
This commit is contained in:
parent
f81ab3d94e
commit
b923ee83b4
@ -43,7 +43,7 @@ call_int13h (struct bootapp_callback_params *params)
|
||||
__asm__ ("pushf\n\t"
|
||||
"pop %0\n\t"
|
||||
: "=r" (eflags));
|
||||
params->eflags = (eflags & ~CF);
|
||||
params->eflags = (eflags & ~CF) | IF;
|
||||
params->vector.interrupt = 0x13;
|
||||
call_interrupt (params);
|
||||
}
|
||||
|
@ -148,6 +148,9 @@ enum eflags
|
||||
AF = (1 << 4),
|
||||
ZF = (1 << 6),
|
||||
SF = (1 << 7),
|
||||
TF = (1 << 8),
|
||||
IF = (1 << 9),
|
||||
DF = (1 << 10),
|
||||
OF = (1 << 11),
|
||||
};
|
||||
|
||||
|
18
kern/int13.c
18
kern/int13.c
@ -80,7 +80,7 @@ static void int13_get_parameters (struct bootapp_callback_params *params)
|
||||
params->dh = max_head;
|
||||
params->dl = num_drives;
|
||||
DBG2 ("Get parameters: C/H/S = %d/%d/%d, drives = %d\n",
|
||||
(max_cylinder + 1), (max_head + 1), max_sector, num_drives);
|
||||
(max_cylinder + 1), (max_head + 1), max_sector, num_drives);
|
||||
|
||||
/* Success */
|
||||
params->ah = 0;
|
||||
@ -102,7 +102,7 @@ static void int13_get_disk_type (struct bootapp_callback_params *params)
|
||||
params->dx = (sector_count & 0xffff);
|
||||
params->ah = drive_type;
|
||||
DBG2 ("Get disk type: sectors = %#08x, type = %d\n",
|
||||
sector_count, drive_type);
|
||||
sector_count, drive_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,10 +144,10 @@ int13_get_extended_parameters (struct bootapp_callback_params *params)
|
||||
disk_params->sectors_per_track = VDISK_SECTORS_PER_TRACK;
|
||||
disk_params->sectors = VDISK_COUNT;
|
||||
disk_params->sector_size = VDISK_SECTOR_SIZE;
|
||||
DBG2 ("Get extended parameters: C/H/S = %d/%d/%d, sectors = %#08llx "
|
||||
"(%d bytes)\n", disk_params->cylinders, disk_params->heads,
|
||||
disk_params->sectors_per_track, disk_params->sectors,
|
||||
disk_params->sector_size);
|
||||
DBG2 ("Get extended parameters: C/H/S = %d/%d/%d, sectors = %#llx "
|
||||
"(%d bytes)\n", disk_params->cylinders, disk_params->heads,
|
||||
disk_params->sectors_per_track, disk_params->sectors,
|
||||
disk_params->sector_size);
|
||||
|
||||
/* Success */
|
||||
params->ah = 0;
|
||||
@ -167,7 +167,7 @@ static void int13_extended_read (struct bootapp_callback_params *params)
|
||||
/* Read from emulated disk */
|
||||
disk_address = REAL_PTR (params->ds, params->si);
|
||||
data = REAL_PTR (disk_address->buffer.segment,
|
||||
disk_address->buffer.offset);
|
||||
disk_address->buffer.offset);
|
||||
vdisk_read (disk_address->lba, disk_address->count, data);
|
||||
|
||||
/* Success */
|
||||
@ -193,8 +193,8 @@ void emulate_int13 (struct bootapp_callback_params *params)
|
||||
|
||||
/* Populate eflags with a sensible starting value */
|
||||
__asm__ ("pushf\n\t"
|
||||
"pop %0\n\t"
|
||||
: "=r" (eflags));
|
||||
"pop %0\n\t"
|
||||
: "=r" (eflags));
|
||||
params->eflags = (eflags & ~CF);
|
||||
|
||||
/* Handle command */
|
||||
|
Loading…
x
Reference in New Issue
Block a user