Compare commits

..

No commits in common. "352db828e706acf2371525272618268ff64d8e2a" and "51641284bccf3184f84edc2b45f9b568ef027caa" have entirely different histories.

7 changed files with 22 additions and 71 deletions

View File

@ -1,52 +0,0 @@
/************************
*** Team Kitty, 2019 ***
*** Sync ***
***********************/
/* The entry point of the UEFI app.
* When the firmware loads the app,
* it calls the efi_main function.
*
* When it is called, the processor
* is running in 32-bit Protected mode.
* It is given a map of memory, and there
* are a bunch of Boot Services provided
* by the UEFI firmware.
*
* See uefi/docs for more information.
*/
//Example stolen from osdev.org/uefi_bare_bones
#include <efi.h>
#include <efilib.h>
EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
EFI_STATUS Status;
EFI_INPUT_KEY Key;
/* Store the system table for future use in other functions */
ST = SystemTable;
/* Say hi */
Status = ST->ConOut->OutputString(ST->ConOut, L"Hello World\n\r");
if (EFI_ERROR(Status))
return Status;
/* Now wait for a keystroke before continuing, otherwise your
message will flash off the screen before you see it.
First, we need to empty the console input buffer to flush
out any keystrokes entered before this point */
Status = ST->ConIn->Reset(ST->ConIn, FALSE);
if (EFI_ERROR(Status))
return Status;
/* Now wait until a key becomes available. This is a simple
polling implementation. You could try and use the WaitForKey
event instead if you like */
while ((Status = ST->ConIn->ReadKeyStroke(ST->ConIn, &Key)) == EFI_NOT_READY) ;
return Status;
}

7
iso/boot/grub/grub.cfg Normal file
View File

@ -0,0 +1,7 @@
set timeout=10
set default=0
menuentry "ProjectRED" {
multiboot /boot/red.kernel
boot
}

5
iso/boot/grub/menu.lst Executable file
View File

@ -0,0 +1,5 @@
defualt=0
timeout=0
title ProjectRED
kernel /boot/kernel.elf

BIN
iso/boot/grub/stage2_eltorito Executable file

Binary file not shown.

View File

@ -33,7 +33,7 @@ $(KERNEL_ARCH_OBJS) \
kernel/utils.o \
kernel/serial.o \
kernel/interrupts.o \
kernel/descriptor_tables.o \
kernel/descriptor_tables.o\
kernel/kernel.o
OBJS=\
@ -47,7 +47,7 @@ $(LIBS) \
.PHONY: all clean install install-headers install-kernel
.SUFFIXES: .o .c .s
all: BOOTX64.EFI
all: red.kernel
red.kernel: $(OBJS) $(ARCHDIR)/linker.ld
$(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(LINK_LIST)
@ -88,13 +88,4 @@ gen-iso:
-o red.iso \
iso
BOOTX64.EFI: arch/uefi/entry.o efi/lib/data.o
$(EFI-CC) -nostdlib -Wl,-dll -shared -Wl,--subsystem,10 -e efi_main -o BOOTX64.EFI arch/uefi/entry.o data.o -lgcc
arch/uefi/entry.o:
$(EFI-CC) -ffreestanding -Iinclude/efi/ -Iinclude/efi/x86_64 -Iinclude/efi/protocol -c -o arch/uefi/entry.o arch/uefi/entry.c
efi/lib/data.o:
$(EFI-CC) -ffreestanding -Iinclude/efi/ -Iinclude/efi/x86_64 -Iinclude/efi/protocol -c -o data.o efi/lib/data.c
-include $(OBJS:.o=.d)

BIN
red.kernel Executable file

Binary file not shown.