Board.KolibriOS.org

Official KolibriOS board
It is currently Mon Apr 12, 2021 11:04 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 85 posts ]  Go to page 1 2 3 4 5 6 Next
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: 618
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 348 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: 618
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 221 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: 618
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: 618
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
   
 Post subject: Re: uefi4kos
PostPosted: Tue Oct 06, 2020 7:09 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 618
Current UEFI guide:
  1. Generate DEVICES.DAT file as described from 1 to 6 by Serge. Devman is here.
  2. Put obtained DEVICES.DAT, kolibri.ini, kolibri.img, kolibri.efi and kolibri.krn to EFI System Partition: /EFI/Boot/.
  3. Edit kolibri.ini, e.g. define screen resolution. There is no interactive boot menu in uefi loader.
  4. 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/Boot/kolibri.efi
        }


Top
   
 Post subject: Re: uefi4kos
PostPosted: Sat Oct 24, 2020 11:39 pm 
Offline
User avatar

Joined: Thu Oct 22, 2020 5:41 pm
Posts: 76
I have notebook with UEFI and Flash device. And i try new boot and rufus installer it not work. How to install KolibriOS to Flash device? Do you have automatic installator? Or full manual?

_________________
2004: Kolibri OS - Operating system that fits on a single floppy disk (Система которая умещается на дискете).
2020: Kolibri OS - Operating system that can only be run under Virtual machine (Система которую можно запустить только на виртуальной машине).


Top
   
 Post subject: Re: uefi4kos
PostPosted: Sun Oct 25, 2020 12:47 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 618
  1. Create GPT layout on your flash device.
  2. Create EFI System Partition (ESP) on it.
  3. Format ESP as FAT32.
  4. Make /EFI/BOOT directory on ESP.
  5. Edit kolibri.ini file according to your needs.
  6. Copy kolibri.efi as /EFI/BOOT/BOOTX64.EFI.
  7. Copy kolibri.{krn,img.ini} files to /EFI/BOOT/.
  8. Optionally, copy DEVICES.DAT file to /EFI/BOOT/.

Files kolibri.* and DEVICES.DAT are mentioned in the above posts.

For Linux host and /dev/sdd flash this procedure is as follows:
Code:
# parted -s /dev/sdd mktable gpt
# parted -s /dev/sdd unit MiB mkpart fat32 1 100%
# parted -s /dev/sdd set 1 esp on
# mkfs.vfat -F32 -n KOLIBRIOS /dev/sdd1
mkfs.fat 4.1 (2017-01-24)
# mmd -i /dev/sdd1 ::EFI
# mmd -i /dev/sdd1 ::EFI/BOOT
# mcopy -moi /dev/sdd1 kolibri.efi ::EFI/BOOT/BOOTX64.EFI
# mcopy -moi /dev/sdd1 kolibri.krn ::EFI/BOOT/KOLIBRI.KRN
# mcopy -moi /dev/sdd1 kolibri.img ::EFI/BOOT/KOLIBRI.IMG
# mcopy -moi /dev/sdd1 kolibri.ini ::EFI/BOOT/KOLIBRI.INI

You are welcome to write and share instructions for Windows users.


Top
   
 Post subject: Re: uefi4kos
PostPosted: Tue Oct 27, 2020 10:07 am 
Offline
User avatar

Joined: Thu Oct 22, 2020 5:41 pm
Posts: 76
To Dunkaist

Thank you for the detailed instructions. But I don't have a Linux distribution. Obviously, the Windows 10 distribution does not have such utilities as mktable... Apparently, to run KOS, you must first create a Linux Live USB distribution. Now I understand why this OS is abandoned and so not popular...

On Russian:
Спасибо за развернутую инструкцию. Но у меня нет дистрибутива Linux. Очевидно дистрибутив Windows 10 не имеет таких утилит как mktable... Видимо чтобы запустить KOS нужно сначала создать дистрибутив Linux Live USB. Теперь я понимаю почему эта ОС заброшена и так не популярна...

_________________
2004: Kolibri OS - Operating system that fits on a single floppy disk (Система которая умещается на дискете).
2020: Kolibri OS - Operating system that can only be run under Virtual machine (Система которую можно запустить только на виртуальной машине).


Top
   
 Post subject: Re: uefi4kos
PostPosted: Tue Oct 27, 2020 11:11 am 
Offline
User avatar

Joined: Thu Oct 22, 2020 5:41 pm
Posts: 76
Maybe it possible if use BOOTICE under windows? BOOTICE much powerfull utilite.
https://www.bootdev.ru/2015/10/bootice.html

_________________
2004: Kolibri OS - Operating system that fits on a single floppy disk (Система которая умещается на дискете).
2020: Kolibri OS - Operating system that can only be run under Virtual machine (Система которую можно запустить только на виртуальной машине).


Top
   
 Post subject: Re: uefi4kos
PostPosted: Tue Oct 27, 2020 3:30 pm 
Offline

Joined: Mon Sep 07, 2020 7:09 pm
Posts: 411
Подпись очень обманчива.
Точнее написать: "2020: Kolibri OS - Система которую я могу запустить только с флоппика, и больше с ничего"

_________________
:arrow: Image


Top
   
 Post subject: Re: uefi4kos
PostPosted: Tue Oct 27, 2020 4:20 pm 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 618
Evgeniy wrote:
Thank you for the detailed instructions.
You are welcome.

Evgeniy wrote:
But I don't have a Linux distribution. Obviously, the Windows 10 distribution does not have such utilities as mktable... Apparently, to run KOS, you must first create a Linux Live USB distribution.
Currently it is not possible to partition disks from KolibriOS, therefore you have to use some other OS to do this.
Windows is absolutely okay, you can use standard diskpart utility or any suitable gui tool (mentioned bootice looks promising).

Alternatively, you can try prebuilt flash image. It hasn't been tested properly yet, you can help with this.


Top
   
 Post subject: Re: uefi4kos
PostPosted: Tue Oct 27, 2020 5:12 pm 
Offline
User avatar

Joined: Thu Oct 22, 2020 5:41 pm
Posts: 76
maxcodehack wrote:
Подпись очень обманчива.
Точнее написать: "2020: Kolibri OS - Система которую я могу запустить только с флоппика, и больше с ничего"


Исправил. Флоппи дисководы сейчас уже редко встретишь...

_________________
2004: Kolibri OS - Operating system that fits on a single floppy disk (Система которая умещается на дискете).
2020: Kolibri OS - Operating system that can only be run under Virtual machine (Система которую можно запустить только на виртуальной машине).


Top
   
 Post subject: Re: uefi4kos
PostPosted: Tue Oct 27, 2020 5:37 pm 
Offline
User avatar

Joined: Thu Oct 22, 2020 5:41 pm
Posts: 76
dunkaist wrote:
Evgeniy wrote:
But I don't have a Linux distribution. Obviously, the Windows 10 distribution does not have such utilities as mktable... Apparently, to run KOS, you must first create a Linux Live USB distribution.
Currently it is not possible to partition disks from KolibriOS, therefore you have to use some other OS to do this.
Windows is absolutely okay, you can use standard diskpart utility or any suitable gui tool (mentioned bootice looks promising).

Alternatively, you can try prebuilt flash image. It hasn't been tested properly yet, you can help with this.


Im write youre raw image on usb by rawrite32.

First notebook doesn't see the flash drive as boot uefi, but it have feature "run from file".I found the file "EFI\BOOT\BOOTX64.EFI" is it really on the flash drive? Im run it, and get blue rectangle on black screen with label

'\EFI\BOOT\BOOTX64.EFI boot failed. [OK]"

However, I can't understand why the bootloader is x64? We have a 32-bit system.

... Yep im reboot an test it again. Kolibri Flash drive have file BOOTX64.EFI - thats true.

For example hardrive have 32 bit file bootia32.efi for init system.

Thats All... Anyway, thanks for trying.

Second notebook freezee with logo. Maybe its hardware is not compatible with Kolibri :roll:... Processor is x64, but the motherboard may not be compatible. But other uefi live usb runs ok on this device.

_________________
2004: Kolibri OS - Operating system that fits on a single floppy disk (Система которая умещается на дискете).
2020: Kolibri OS - Operating system that can only be run under Virtual machine (Система которую можно запустить только на виртуальной машине).


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 85 posts ]  Go to page 1 2 3 4 5 6 Next

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 2 guests


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