Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Loading/Running Programs | UEFI Dev (in C)

  • Queso Fuego
  • 2024-02-14
  • 1820
Loading/Running Programs | UEFI Dev (in C)
queso fuegorun programsload fileload programelfpeelf64file formatexeuefi programminguefi devlow levelc programmingelf formatpe format64 bit
  • ok logo

Скачать Loading/Running Programs | UEFI Dev (in C) бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Loading/Running Programs | UEFI Dev (in C) или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Loading/Running Programs | UEFI Dev (in C) бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Loading/Running Programs | UEFI Dev (in C)

Running a program instead of just printing text files.
A program or executable file has a format like any other type of file, and in C it's a relatively simple matter of loading data structures to match the format, loading needed sections of the program to a new buffer, getting the new entry point, and calling that entry point to run the program.

A PE file can be slightly easier to load than an ELF file as the PE format has fields for the total size of the loaded file and its sections, and the entry point and section virtual addresses are already relative and do not need to be computed, for a PIE executable.

Errata:
It's probably a bug loading the ELF program headers' p_memsz amount of data instead of p_filesz.
It's possible that filesz is non-zero while memsz is 0 or at least less than filesz.
Using filesz instead would more closely match the PE loading and would fix any ambiguity and future bugs. The difference in filesz and memsz is implicitly zero padded anyway from memset-ing the
whole buffer to 0.

Random output from printf() was usually from taking 4+ bytes from the argument's memory on the stack via va_arg() inside printf, when the argument is actually 8 or 16 bits. My guess is due to compiler optimizations or otherwise not using address/size prefix bytes in the compiled code.
A fix could be to add size or length specifiers in the formatted string to be parsed by printf, e.g. %xbits8 or %xz8 for 8 bits. Or look up how gcc and others work around those issues.

Notes:
Sorry about any flashbangs, could've used a darker color for drawing to the framebuffer.

Probably could have used (elf header + sizeof elf_header_var) or (input_buffer + elf_header_phoff) to get to the program headers instead, which may make a little more sense for the ELF layout as the program headers immediately follow the overall Elf header.

I also kept thinking the default text line length was 25 characters instead of 80. The senility's kicking in early these days.

Links:
https://uefi.org/specifications (uefi & other specifications)
https://en.wikipedia.org/wiki/Executa...
https://en.wikipedia.org/wiki/Portabl...
https://learn.microsoft.com/en-us/win...
https://github.com/mentebinaria/readpe (readelf-esque tool for PE files)

UEFI Programming playlist:
   • UEFI Programming in C  

Git Repo:
https://github.com/queso-fuego/uefi-dev
https://codeberg.org/queso_fuego/uefi...

Repo state at the start of this video:
git clone --recurse-submodules https://github.com/queso-fuego/uefi-dev
cd uefi-dev
git checkout 20ff7f39ba9ca2aade5ffce975b9ff08ee8e2044

Repo state at the end of this video:
git checkout 1de80a5fba694550cbb8095d415a0d8f087bf6b7

Next video:
Getting the memory map and exiting boot services, and maybe making an installer option to write the disk image and kernel to another disk. That way you could "install" everything and reboot to use the new OS or loaded program.

Join the Community Discord:   / discord  

Contact:
https://queso_fuego.codeberg.page/contact.html

Support:
https://queso_fuego.codeberg.page/support.html

Questions about setup/software/etc.?
Check the FAQ: https://queso_fuego.codeberg.page/about.html

0:00:00 intro, add example program to draw to screen
0:14:45 change load file function to load flat binary program
0:28:07 close timer event before running program
0:29:28 "fix" void pointer to function pointer cast
0:31:13 load flat binary from PE obj instead of ELF
0:34:32 build elf & pe from makefile, check header bytes
0:44:17 ELF structs for basic ELF64 format
0:50:30 print info and load ELF file (copy paste my own code)
1:25:18 PE structs and info for basic PE32+ format
1:43:09 print info and load PE file
2:19:15 coming up & outro

Music credits:
"Acid Trumpet" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
http://creativecommons.org/licenses/b...

[Chiptune] Medieval: Minstrel Dance by RandomMind
Music: https://www.chosic.com/free-music/all/

#uefidev #cprogramming #PIEhole

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]