kernel: Don't read acpi_dev_* vars that if uninitialized.

Currently only uefi4kos loader initializes these variables. May be one
day BIOS loaders will load DEVICES.DAT file and initialize these vars
too, may be one day we will detect APIC IRQs via ACPI. But not today.

git-svn-id: svn://kolibrios.org@8117 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Baravy 2020-10-26 04:29:48 +00:00
parent 70798cbfe0
commit 8e5b79b154
3 changed files with 6 additions and 3 deletions

View File

@ -825,7 +825,7 @@ for i,v in ipairs(distr_extra_files) do
end end
-- generate command and dependencies for kolibri.raw -- generate command and dependencies for kolibri.raw
input_deps = {"kolibri.img", "../kernel/trunk/bootloader/extended_primary_loader/fat32/kordldr.f32.bin", "../kernel/trunk/bootloader/extended_primary_loader/fat32/bootsect.bin", "../kernel/trunk/kernel.mnt.ext_loader"} input_deps = {"kolibri.img", "../kernel/trunk/bootloader/extended_primary_loader/fat32/kordldr.f32", "../kernel/trunk/bootloader/extended_primary_loader/fat32/bootsect.bin", "../kernel/trunk/kernel.mnt.ext_loader"}
make_raw_command = '^ MKIMG kolibri.raw^ ' -- for tup: don't write full command to logs make_raw_command = '^ MKIMG kolibri.raw^ ' -- for tup: don't write full command to logs
make_raw_command = make_raw_command .. "dd if=/dev/zero of=kolibri.raw bs=1048576 count=64 2>&1" make_raw_command = make_raw_command .. "dd if=/dev/zero of=kolibri.raw bs=1048576 count=64 2>&1"
make_raw_command = make_raw_command .. " && parted --script kolibri.raw mktable msdos" make_raw_command = make_raw_command .. " && parted --script kolibri.raw mktable msdos"
@ -835,7 +835,7 @@ bootsector = "../kernel/trunk/bootloader/extended_primary_loader/fat32/bootsect.
make_raw_command = make_raw_command .. " && mformat -i kolibri.raw@@1M -v KOLIBRIOS -T 129024 -h 16 -s 32 -H 2048 -c 1 -F -B " .. bootsector .. " ::" make_raw_command = make_raw_command .. " && mformat -i kolibri.raw@@1M -v KOLIBRIOS -T 129024 -h 16 -s 32 -H 2048 -c 1 -F -B " .. bootsector .. " ::"
make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M ../kernel/trunk/kernel.mnt.ext_loader ::KERNEL.MNT" make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M ../kernel/trunk/kernel.mnt.ext_loader ::KERNEL.MNT"
make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M kolibri.img ::KOLIBRI.IMG" make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M kolibri.img ::KOLIBRI.IMG"
make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M ../kernel/trunk/bootloader/extended_primary_loader/fat32/kordldr.f32.bin ::KORDLDR.F32" make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M ../kernel/trunk/bootloader/extended_primary_loader/fat32/kordldr.f32 ::KORDLDR.F32"
make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M ../kernel/trunk/bootloader/extended_primary_loader/config.ini ::CONFIG.INI" make_raw_command = make_raw_command .. " && mcopy -moi kolibri.raw@@1M ../kernel/trunk/bootloader/extended_primary_loader/config.ini ::CONFIG.INI"
make_raw_command = make_raw_command .. ' && mmd -i kolibri.raw@@1M ::KOLIBRIOS' make_raw_command = make_raw_command .. ' && mmd -i kolibri.raw@@1M ::KOLIBRIOS'

View File

@ -1,3 +1,3 @@
if tup.getconfig("NO_FASM") ~= "" then return end if tup.getconfig("NO_FASM") ~= "" then return end
tup.rule("bootsect.asm", "fasm %f %o", "bootsect.bin") tup.rule("bootsect.asm", "fasm %f %o", "bootsect.bin")
tup.rule("kordldr.f32.asm", "fasm %f %o", "kordldr.f32.bin") tup.rule("kordldr.f32.asm", "fasm %f %o", "kordldr.f32")

View File

@ -55,12 +55,15 @@ APIC_init:
cmp [acpi_lapic_base], 0 cmp [acpi_lapic_base], 0
jz .no_apic jz .no_apic
; non-UEFI loaders don't load DEVICES.DAT and don't initialize [acpi_dev_size]
if defined UEFI
cmp [acpi_dev_size], 0 cmp [acpi_dev_size], 0
jz @f jz @f
stdcall map_io_mem, [acpi_dev_data], [acpi_dev_size], PG_SWR stdcall map_io_mem, [acpi_dev_data], [acpi_dev_size], PG_SWR
mov [acpi_dev_data], eax mov [acpi_dev_data], eax
jmp .loaded jmp .loaded
@@: @@:
end if
stdcall load_file, dev_data_path stdcall load_file, dev_data_path
test eax, eax test eax, eax