Board.KolibriOS.org

Official KolibriOS board
It is currently Fri Sep 20, 2019 11:52 pm

All times are UTC+03:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: uefi4kos
PostPosted: Mon Apr 25, 2016 10:43 pm 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 428
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 187 times
Top
   
 Post subject: Re: uefi4kos
PostPosted: Mon Apr 25, 2016 11:13 pm 
Offline

Joined: Wed May 18, 2005 7:27 pm
Posts: 1001
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


Top
   
 Post subject: Re: uefi4kos
PostPosted: Wed Dec 06, 2017 10:12 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 428
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 103 times
Top
   
 Post subject: Re: uefi4kos
PostPosted: Fri Feb 22, 2019 1:53 pm 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 428
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
        }


Top
   
 Post subject: Re: uefi4kos
PostPosted: Mon Feb 25, 2019 12:17 am 
Offline

Joined: Sat Jan 19, 2019 5:17 pm
Posts: 73
What about minimum system requirements?
How to modify the image? Sorry for offtopic.

_________________
:?: :arrow: :idea:


Top
   
 Post subject: Re: uefi4kos
PostPosted: Wed Feb 27, 2019 2:50 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 428
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited