setos

拙OS
Log | Files | Refs

commit 710525bc8aa30bc58163f35a7249ab1fa79b1358
parent d296bb5d11fa659ab4fa095e898d70e404bc22f6
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Fri, 15 Mar 2024 13:16:07 +0900

delete ___stkchk_ms and add '-mno-stack-arg-probe' option to CFLAGS

Diffstat:
MMakefile | 3++-
Mhello.c | 5+++--
Mutils.c | 5-----
Mutils.h | 2--
4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,5 +1,6 @@ CC = x86_64-w64-mingw32-gcc -CFLAGS = -shared -nostdinc -nostdlib -mno-red-zone -fno-stack-protector -Wall -e EfiMain +CFLAGS = -shared -nostdinc -nostdlib -mno-red-zone -fno-stack-protector \ + -mno-stack-arg-probe -Wall -e EfiMain OBJCOPY = objcopy SRC = hello.c utils.c HDR = uefi.h diff --git a/hello.c b/hello.c @@ -11,8 +11,8 @@ EfiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) SystemTable->ConOut->OutputString(SystemTable->ConOut, SystemTable->FirmwareVendor); // Output memory map information. - UINTN mmsize = sizeof(EFI_MEMORY_DESCRIPTOR) * 150; // ? - EFI_MEMORY_DESCRIPTOR mmap[150]; + UINTN mmsize = sizeof(EFI_MEMORY_DESCRIPTOR) * 1024; + EFI_MEMORY_DESCRIPTOR mmap[1024]; UINTN mkey; UINTN dsize; UINT32 dver; @@ -21,6 +21,7 @@ EfiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) if (stat != EFI_SUCCESS) { return stat; } + SystemTable->ConOut->OutputString(SystemTable->ConOut, sprinth(mmap[0].Type, s)); // Echo back user input. EFI_INPUT_KEY Key; diff --git a/utils.c b/utils.c @@ -18,7 +18,3 @@ sprinth(UINT64 n, CHAR16 s[19]) s[19] = L'\0'; return s; } - -void -___chkstk_ms(void) -{} -\ No newline at end of file diff --git a/utils.h b/utils.h @@ -4,4 +4,3 @@ // It returns the second argument. // The second argument should have length of 19 ("0x" + "0123456789abcdef" + "\0"). CHAR16 *sprinth(UINT64, CHAR16[19]); -void ___chkstk_ms(void); -\ No newline at end of file