mirror of https://github.com/0Nera/BMOSP.git
Мелкие исправления и оптимизации модулей
This commit is contained in:
parent
bed0cd45e6
commit
a2be2a4add
|
@ -82,6 +82,8 @@ static inline void scan( ) {
|
|||
|
||||
uint16_t device_id = get_device_id(bus, slot, function);
|
||||
uint16_t class_id = get_class_id(bus, slot, function);
|
||||
|
||||
/*
|
||||
uint16_t status = pci_read_word(bus, slot, function, 0x6);
|
||||
uint32_t mem_addr_0 = pci_read_word(bus, slot, function, 0x1C);
|
||||
uint32_t mem_addr_1 = pci_read_word(bus, slot, function, 0x24);
|
||||
|
@ -91,18 +93,20 @@ static inline void scan( ) {
|
|||
uint32_t io_addr_1 = pci_read_word(bus, slot, function, 0x34);
|
||||
uint32_t io_lim_0 = pci_read_word(bus, slot, function, 0x30);
|
||||
uint32_t io_lim_1 = pci_read_word(bus, slot, function, 0x38);
|
||||
*/
|
||||
|
||||
char *name = find_vendor(vendor);
|
||||
fb_printf("[%u] %x [%s], устройство: %x, класс: %u, "
|
||||
"%u.%u.%u\n",
|
||||
devices, vendor, name, device_id, class_id, bus, slot, function);
|
||||
fb_printf("\t\\->%s", get_class_name(class_id));
|
||||
fb_printf("[%u] %x [%s], устройство: %x, %u.%u.%u | ", devices, vendor, name, device_id, bus, slot,
|
||||
function);
|
||||
fb_printf("%s\n", get_class_name(class_id));
|
||||
|
||||
/*
|
||||
fb_printf(" | 0x%x : 0x%x", mem_addr_0, mem_lim_0);
|
||||
fb_printf(" | 0x%x : 0x%x", mem_addr_1, mem_lim_1);
|
||||
fb_printf(" | 0x%x : 0x%x", io_addr_0, io_lim_0);
|
||||
fb_printf(" | 0x%x : 0x%x", io_addr_1, io_lim_1);
|
||||
fb_printf(" | 0x%x\n", status);
|
||||
|
||||
*/
|
||||
devices++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ static inline void virt_exit( ) {
|
|||
static void handler( ) {
|
||||
fb_printf("Получено прерывание, обработка\n");
|
||||
|
||||
while (!(inb(0x64) & 1)) {}
|
||||
while (!(inb(0x64) & 1)) { asm volatile("pause"); }
|
||||
|
||||
uint64_t byte = inb(0x60);
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ static unsigned int *tga_parse(unsigned char *ptr, int size) {
|
|||
|
||||
static void *handler(uint64_t func) {
|
||||
switch (func) {
|
||||
case 0: return &tga_parse;
|
||||
case 0: return tga_parse;
|
||||
|
||||
default: return NULL;
|
||||
}
|
||||
|
@ -150,6 +150,7 @@ static void *handler(uint64_t func) {
|
|||
|
||||
module_info_t __attribute__((section(".minit"))) init(env_t *env) {
|
||||
init_env(env);
|
||||
|
||||
return (module_info_t){ .name = (char *)"[MEDIA][TGA]",
|
||||
.message = (char *)"Отрисовка TGA изображений",
|
||||
.type = 0,
|
||||
|
|
Loading…
Reference in New Issue