Board.KolibriOS.org
http://board.kolibrios.org/

uefi4kos
http://board.kolibrios.org/viewtopic.php?f=34&t=3270
Page 1 of 1

Author:  dunkaist [ Mon Apr 25, 2016 10:43 pm ]
Post subject:  uefi4kos

Hello,

I implemented a small UEFI module to boot kolibri without CSM, find it here.

It is done in fasm, using uefi.inc. A thread by XVilka was especially helpful for booting on real hardware.

How it works:
- Choose and set video mode via UEFI graphics output protocol;
- Get memory map and convert it to E820 format;
- Load kernel and disk image into memory;
- Set boot params at 0x9000+;
- Load new GDT;
- Go to compatibility and then protected mode;
- Clear cr4.pae bit;
- Jump to the kernel.

What doesn't work:
- 'blue screen' (to choose video mode type its number and press enter, no indication so far!);
- reboot/poweroff.

Attachments:
uefi4kos.7z [1.19 MiB]
Downloaded 160 times

Author:  Wildwest [ Mon Apr 25, 2016 11:13 pm ]
Post subject:  Re: uefi4kos

Any screenshot?

Here is how to use it
https://en.wikipedia.org/wiki/Unified_E ... ce#Booting

https://ru.wikipedia.org/wiki/Extensibl ... D0.B2_UEFI

Author:  dunkaist [ Wed Dec 06, 2017 10:12 am ]
Post subject:  Re: uefi4kos

Hello.

Current kernel.asm (read: kernel.mnt) starts with 16-bit bios-related part which is of no use for UEFI loader that wants to jump just after this part, to os_code:B32. Unfortunately, B32 label offset depends on the size of preceeding 16-bit code and therefore UEFI loader can't guess where to jump.

I attached a patch that splits bootbios.asm and kernel.asm:
  • Move bios-related part of kernel.asm before B32 label to bootbios.asm file;
  • Move bx_from_load, boot_dev and kernel_restart_bootblock variables to BOOT_* 0x9000 block;
  • Update Tupfile.lua, Makefile, build.bat, build.sh accordingly;
  • Now bios and uefi loaders can jump to very first byte of the kernel.

Any objections?

Attachments:
bootbios.diff [18.4 KiB]
Downloaded 77 times

Author:  dunkaist [ Fri Feb 22, 2019 1:53 pm ]
Post subject:  Re: uefi4kos

Current UEFI guide for brave:
  1. Download the latest floppy image nightbuild.
  2. Download the latest devman by Serge.
  3. Copy acpi and acpi.dll files to /drivers directory.
  4. Boot this modified image any way you can.
  5. Run /drivers/acpi manually.
  6. Copy /drivers/devices.dat somewhere or open it in the hex editor and take a photo.
  7. Boot into your main OS, remove /drivers/acpi*, copy devices.dat to /drivers.
  8. Put resulting kolibri.img to /data directory in your local source tree.
  9. Go to /kernel/trunk. Run fasm kernel.asm kernel.bin -dUEFI=1.
  10. Go to /kernel/trunk/boot. Run fasm uefi4kos.asm kolibri.efi.
  11. Add kolibri.efi to your bootloader's config file. E.g. for grub (aka grub2) menuentry is as follows:
Code:
menuentry "KolibriOS" {
                insmod part_gpt
                insmod fat
                insmod chain
                chainloader /EFI/kolibri.efi
        }

Author:  Antonio [ Mon Feb 25, 2019 12:17 am ]
Post subject:  Re: uefi4kos

What about minimum system requirements?
How to modify the image? Sorry for offtopic.

Author:  dunkaist [ Wed Feb 27, 2019 2:50 am ]
Post subject:  Re: uefi4kos

Antonio wrote:
What about minimum system requirements?
uefi4kos is a bootloader, it takes few MBs. In theory, it should work on most modern computers with 64-bit UEFI and Secure Boot disabled.
APIC and interrupts are still an issue. You can workaround it as Serge suggested here.

Antonio wrote:
How to modify the image? Sorry for offtopic.
https://wiki.osdev.org/Disk_Images

Page 1 of 1 All times are UTC+03:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/