Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs change + Fix some CRT0 symbols #45

Merged
merged 9 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .vs/apps/tpause.vcxproj

This file was deleted.

18 changes: 0 additions & 18 deletions .vs/apps/tpause.vcxproj.filters

This file was deleted.

9 changes: 0 additions & 9 deletions apps/tpause.c

This file was deleted.

47 changes: 0 additions & 47 deletions apps/trivial.S

This file was deleted.

13 changes: 13 additions & 0 deletions docs/README.ABI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@ versions

This currently includes the following functions:
- ReallocatePool

Inputs were re-ordered

- CopyMem

Source is no longer marked as constant

CopyMemC is introduced as a helper function when using a constant source input

- CompareGuid

Function now returns BOOLEAN instead of INTN
Return codes are now reversed

**Will break at runtime - likely causing opposite output to expected**

2) Applications which haven't been updated in a while may also be missing the
required `.rodata` section which contains needed read-only data which will prevent
Expand Down
20 changes: 15 additions & 5 deletions docs/README.git.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ Generating releases on GitHub is a very simple process;
2) Enter the version number in the tag field, selecting "create tag on publish"

**Ignore GitHub's suggestion of prefixing the version with a "v"**
3) **OPTIONAL**
Add a release description and/or a list of pull requests and contributors via "Generate release notes"
4) For alpha/beta versions, set it to be a pre-release
5) Release the new version
6) GitHub will automatically generate a GZ compressed TAR file and a ZIP file of the repo
3) Set previous tag manually

- Last stable for stable releases
- Last alpha/beta for alpha/beta releases

**Ensures GitHub sets the Full Changelog to be between the last release in the cycle**
**and not the start of the repository**
4) Add a release title - use the version number

**Otherwise GitHub will add the last commit name as the title**
5) ***OPTIONAL***
Add a release description *and/or* a list of pull requests and contributors via "Generate release notes"
6) For alpha/beta versions, set it to be a pre-release
7) Release the new version
8) GitHub will automatically generate a GZ compressed TAR file and a ZIP file of the repo



Expand Down
19 changes: 19 additions & 0 deletions docs/README.packaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Packaging gnu-efi

## Set variables per distro configuration

make should be called with the following variables:

- PREFIX (defaults to `/usr/local`)(`%{_prefix}` on RPM distros)
- EXEC_PREFIX (*optional*) (defaults to `$PREFIX`) (`%{_exec_prefix}` on RPM distros)
- LIBDIR (defaults to `$EXEC_PREFIX/lib`) (`%{_libdir}` on RPM distros)
- INCLUDEDIR (*optional*) (defaults to `$PREFIX/include`) (`%{_includedir}` on RPM distros)
- LINUX_HEADERS (*optional*) (**build only**) - location of Linux kernel header files (defaults to `/usr/src/sys/build`)
- DESTDIR (**install only**) - installation output directory (`%{buildroot}` on RPM distros - included in `%make_install`)

Currently, these variables unless stated will need to be set for both build and installation stages.

Those without optional markers I heavily suggest you to set them otherwise files may be located in the wrong directory
for the architecture which you are building for

*The related RPM variables are included here for cross referencing purposes*
22 changes: 0 additions & 22 deletions gnu-efi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcc", ".vs\apps\tcc.vcxproj
{3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tpause", ".vs\apps\tpause.vcxproj", "{8E407F19-F112-4630-B879-CFF982791261}"
ProjectSection(ProjectDependencies) = postProject
{3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unsetdbg", ".vs\apps\unsetdbg.vcxproj", "{06089797-265A-4FF5-838E-25374C1F0159}"
ProjectSection(ProjectDependencies) = postProject
{3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974}
Expand Down Expand Up @@ -464,22 +459,6 @@ Global
{6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA}.Release|ia32.Build.0 = Release|Win32
{6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA}.Release|x64.ActiveCfg = Release|x64
{6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA}.Release|x64.Build.0 = Release|x64
{8E407F19-F112-4630-B879-CFF982791261}.Debug|aa64.ActiveCfg = Debug|ARM64
{8E407F19-F112-4630-B879-CFF982791261}.Debug|aa64.Build.0 = Debug|ARM64
{8E407F19-F112-4630-B879-CFF982791261}.Debug|arm.ActiveCfg = Debug|ARM
{8E407F19-F112-4630-B879-CFF982791261}.Debug|arm.Build.0 = Debug|ARM
{8E407F19-F112-4630-B879-CFF982791261}.Debug|ia32.ActiveCfg = Debug|Win32
{8E407F19-F112-4630-B879-CFF982791261}.Debug|ia32.Build.0 = Debug|Win32
{8E407F19-F112-4630-B879-CFF982791261}.Debug|x64.ActiveCfg = Debug|x64
{8E407F19-F112-4630-B879-CFF982791261}.Debug|x64.Build.0 = Debug|x64
{8E407F19-F112-4630-B879-CFF982791261}.Release|aa64.ActiveCfg = Release|ARM64
{8E407F19-F112-4630-B879-CFF982791261}.Release|aa64.Build.0 = Release|ARM64
{8E407F19-F112-4630-B879-CFF982791261}.Release|arm.ActiveCfg = Release|ARM
{8E407F19-F112-4630-B879-CFF982791261}.Release|arm.Build.0 = Release|ARM
{8E407F19-F112-4630-B879-CFF982791261}.Release|ia32.ActiveCfg = Release|Win32
{8E407F19-F112-4630-B879-CFF982791261}.Release|ia32.Build.0 = Release|Win32
{8E407F19-F112-4630-B879-CFF982791261}.Release|x64.ActiveCfg = Release|x64
{8E407F19-F112-4630-B879-CFF982791261}.Release|x64.Build.0 = Release|x64
{06089797-265A-4FF5-838E-25374C1F0159}.Debug|aa64.ActiveCfg = Debug|ARM64
{06089797-265A-4FF5-838E-25374C1F0159}.Debug|aa64.Build.0 = Debug|ARM64
{06089797-265A-4FF5-838E-25374C1F0159}.Debug|arm.ActiveCfg = Debug|ARM
Expand Down Expand Up @@ -521,7 +500,6 @@ Global
{04D2685F-8150-47E0-BC10-338D2D6B804C} = {DF105116-5A3A-4D48-AB1D-7221690ED545}
{6C664A44-BC53-4225-A14B-D969D4EED647} = {DF105116-5A3A-4D48-AB1D-7221690ED545}
{6E45A33B-E4A0-48D4-81AE-ACFD46FDB1CA} = {DF105116-5A3A-4D48-AB1D-7221690ED545}
{8E407F19-F112-4630-B879-CFF982791261} = {DF105116-5A3A-4D48-AB1D-7221690ED545}
{06089797-265A-4FF5-838E-25374C1F0159} = {DF105116-5A3A-4D48-AB1D-7221690ED545}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
15 changes: 5 additions & 10 deletions gnuefi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,13 @@ clean:
install:
mkdir -p $(INSTALLROOT)$(LIBDIR)
$(INSTALL) -m 644 $(TARGETS) $(INSTALLROOT)$(LIBDIR)
ifeq ($(USING_FREEBSD),1)
ifeq ($(ARCH),x86_64)
ifneq (,$(filter $(ARCH),x86_64 ia32))
$(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_fbsd_efi.lds $(INSTALLROOT)$(LIBDIR)
else
ifneq (,$(filter $(ARCH),aarch64 riscv64 ia32))
$(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi_local.lds $(INSTALLROOT)$(LIBDIR)
endif
$(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)
endif
else
$(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)
endif
ifneq (,$(filter $(ARCH),aarch64 riscv64 ia32))
$(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi_local.lds $(INSTALLROOT)$(LIBDIR)
endif
$(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)
$(INSTALL) -d $(INSTALLROOT)$(PKGCONFIGDIR)
$(INSTALL) -m 644 gnu-efi.pc $(INSTALLROOT)$(PKGCONFIGDIR)

Expand Down
2 changes: 1 addition & 1 deletion gnuefi/crt0-efi-aarch64-local.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pe_header:
.2byte 0
coff_header:
.2byte 0xaa64 // AArch64
.2byte NR_SECTIONS // nr_sections
.2byte 4 // nr_sections
.4byte 0 // TimeDateStamp
.4byte 0 // PointerToSymbolTable
.4byte 0 // NumberOfSymbols
Expand Down
21 changes: 11 additions & 10 deletions gnuefi/crt0-efi-arm.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ optional_header:
.2byte 0x10b // PE32+ format
.byte 0x02 // MajorLinkerVersion
.byte 0x14 // MinorLinkerVersion
.4byte _etext - _start // SizeOfCode
.4byte _text_size - ImageBase // SizeOfCode
.4byte _alldata_size - ImageBase // SizeOfInitializedData
.4byte 0 // SizeOfUninitializedData
.4byte _start - ImageBase // AddressOfEntryPoint
.4byte _start - ImageBase // BaseOfCode
.4byte _text - ImageBase // AddressOfEntryPoint
.4byte _text - ImageBase // BaseOfCode
.4byte _reloc - ImageBase // BaseOfData

extra_header_fields:
Expand All @@ -67,7 +67,7 @@ extra_header_fields:
.4byte _image_end - ImageBase // SizeOfImage

// Everything before the kernel image is considered part of the header
.4byte _start - ImageBase // SizeOfHeaders
.4byte _text - ImageBase // SizeOfHeaders
.4byte 0 // CheckSum
.2byte EFI_SUBSYSTEM // Subsystem
.2byte 0 // DllCharacteristics
Expand Down Expand Up @@ -100,10 +100,10 @@ extra_header_fields:
section_table:

.ascii ".text\0\0\0"
.4byte _evtext - _start // VirtualSize
.4byte _start - ImageBase // VirtualAddress
.4byte _etext - _start // SizeOfRawData
.4byte _start - ImageBase // PointerToRawData
.4byte _text_vsize - ImageBase // VirtualSize
.4byte _text - ImageBase // VirtualAddress
.4byte _text_size - ImageBase // SizeOfRawData
.4byte _text - ImageBase // PointerToRawData
.4byte 0 // PointerToRelocations (0 for executables)
.4byte 0 // PointerToLineNumbers (0 for executables)
.2byte 0 // NumberOfRelocations (0 for executables)
Expand Down Expand Up @@ -148,7 +148,7 @@ section_table:
.2byte 0 // NumberOfLineNumbers
.4byte 0x40000040 // Characteristics (section flags)

.balign 256
.text
.globl _start
.type _start,%function
_start:
Expand All @@ -159,7 +159,8 @@ _start:
adr r1, .L_DYNAMIC
ldr r0, [r1]
add r1, r0, r1
adr r0, ImageBase
adr r0, _start
sub r0, r0, #0x1000
bl _relocate
teq r0, #0
bne 0f
Expand Down
11 changes: 6 additions & 5 deletions gnuefi/crt0-efi-ia32-local.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ optional_header:
.2byte 0x10b // PE32+ format
.byte 0x02 // MajorLinkerVersion
.byte 0x14 // MinorLinkerVersion
.4byte _etext - _start // SizeOfCode
.4byte _text_size - ImageBase // SizeOfCode
.4byte _alldata_size - ImageBase // SizeOfInitializedData
.4byte 0 // SizeOfUninitializedData
.4byte _start - ImageBase // AddressOfEntryPoint
Expand Down Expand Up @@ -82,10 +82,10 @@ extra_header_fields:
section_table:

.ascii ".text\0\0\0"
.4byte _evtext - _start // VirtualSize
.4byte _start - ImageBase // VirtualAddress
.4byte _etext - _start // SizeOfRawData
.4byte _start - ImageBase // PointerToRawData
.4byte _text_vsize - ImageBase // VirtualSize
.4byte _text - ImageBase // VirtualAddress
.4byte _text_size - ImageBase // SizeOfRawData
.4byte _text - ImageBase // PointerToRawData
.4byte 0 // PointerToRelocations (0 for executables)
.4byte 0 // PointerToLineNumbers (0 for executables)
.2byte 0 // NumberOfRelocations (0 for executables)
Expand Down Expand Up @@ -130,6 +130,7 @@ section_table:
.2byte 0 // NumberOfLineNumbers
.4byte 0x40000040 // Characteristics (section flags)

.text
.globl _start
.type _start,%function
_start:
Expand Down
1 change: 1 addition & 0 deletions gnuefi/elf_arm_efi.lds
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SECTIONS
{
.text 0 : {
*(.text.head)
. = 0x1000;
_text = .;
*(.text)
*(.text.*)
Expand Down
24 changes: 0 additions & 24 deletions inc/inc.mak

This file was deleted.

34 changes: 0 additions & 34 deletions inc/make.inf

This file was deleted.

Loading