From 28fcae227cced855710c04617d26e8c84ab44c81 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 10 Oct 2013 00:38:53 +0200 Subject: [PATCH] Stage 1 boot loader: Load the first file matching haiku_loader* This allows naming the boot loader package canoncically. Due to code size limitations we cannot perform a more correct name check, but there shouldn't be any other entries in the packages directory with a name with "haiku_loader" prefix, anyway. --- src/system/boot/platform/bios_ia32/stage1.S | 14 ++++++++++++-- src/system/boot/platform/bios_ia32/stage1.bin | Bin 1024 -> 1024 bytes 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/system/boot/platform/bios_ia32/stage1.S b/src/system/boot/platform/bios_ia32/stage1.S index bbfeca4f29..3d3e0eec76 100644 --- a/src/system/boot/platform/bios_ia32/stage1.S +++ b/src/system/boot/platform/bios_ia32/stage1.S @@ -647,7 +647,8 @@ kErrorString db "Failed to load OS. Press any key to reboot..." kPathComponents: pathComponent "system" pathComponent "packages" -pathComponent "haiku_loader.hpkg" +kLastPathComponent: +pathComponent "haiku_loader" db 0 @@ -882,10 +883,19 @@ continueMain: push bp sub bp, dx + ; Compare the key length. For the last component we only want to check + ; whether the prefix matches. + cmp cx, bp + jg .skip_key + + cmp di, kLastPathComponent + 1 + je .compare_keys + cmp cx, bp jne .skip_key - ; compare path component (di) with key (si), length cx (== bp) + ; compare path component (di) with key (si), length cx (<= bp) +.compare_keys: pusha repe cmpsb popa diff --git a/src/system/boot/platform/bios_ia32/stage1.bin b/src/system/boot/platform/bios_ia32/stage1.bin index e348e81a5518fe9b0688f9676e7f1981d65404cc..ba89d0e5e1b34c9ee6d734df844b41d212178280 100644 GIT binary patch delta 147 zcmZqRXyDi&!6Y5dz=*j}8Ptik9hkO>y#PMZ!9ES%iP7{bewk(ilX z8lRJ&n37sFnUP6m^FKxbMwT-SFIG(!V$Kq@>DG@5)x2u?vRkUDNXS}$?dd>Y5dz=*j^l%tik9h5DymQPMZ!9OrPAy7$PK?k(ilX z8lRJ&n37tgmr;0Y;WX3@;W;7Glm~H|o}p3e~(ixtCc*J@3D>GvmA0 ur=y}?PfbfmGkm+(q~XQ9KWUA2CJi^a_F0#(?VDcvvSRWLW(_U|H~;_!|2TpG