home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,990 of 4,255   
   James Harris to Paul Edwards   
   Re: UEFI boot basics   
   27 Nov 23 15:44:27   
   
   From: james.harris.1@gmail.com   
      
   On 25/11/2023 21:16, Paul Edwards wrote:   
   > Hi James.   
   >   
   >> I had missed off code which you would need   
   >> which I didn't write but which is brought   
   >> in by the link step. I'll show the final   
   >> executable's full disassembly below.   
      
   Hi Paul,   
      
   Any idea why your reply appears as a new thread?   
      
   >   
   > You don't need this code if you produce   
   > normal Windows PE executables with the   
   > subsystem set to UEFI.   
   >   
   > So depending on definitions, it would be   
   > simplified if you used the appropriate tools.   
   >   
   > mingw64 has what is required.   
   >   
   > As does UCX64.   
      
   Well, my development environment is Unix so I am not sure that either   
   would fit. More importantly, I think that I can already control what   
   goes in to the finished executable and have tried stripping out the   
   library code, it's just that there's an unresolved problem with the UEFI   
   firmware not liking the result.   
      
   Specifically, if I omit the library code then the UEFI firmware won't   
   run the .efi file. That may be because the file is no longer tagged as   
   relocatable but I'm not sure.   
      
   FWIW my current link step is   
      
   ld -o obj/x64cpu/bootx64b.so obj/x64cpu/bootx64b.o -nostdlib   
   -znocombreloc -T /usr/lib/elf_x86_64_efi.lds -shared -Bsymbolic   
   -L/usr/lib -l:crt0-efi-x86_64.o -lgnuefi -lefi   
      
   and that's converted to PE with   
      
   objcopy obj/x64cpu/bootx64b.so --subsystem=10 --target efi-app-x86_64 -j   
   .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j   
   .reloc -j .eh_frame  bin/x64cpu/bootx64b.efi   
      
   The line to run my UEFI code from a disk image is   
      
   qemu-system-x86_64 -bios /usr/share/qemu/OVMF.fd -drive   
   format=raw,file=/tmp/ehd.img -net none   
      
      
   --   
   James Harris   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca