Skip to content

Commit

Permalink
chore: port the project to osdk
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboard-slayer committed Apr 10, 2023
1 parent cbc8544 commit 73aebd1
Show file tree
Hide file tree
Showing 27 changed files with 60 additions and 98 deletions.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@ EfiStatus efi_main(EfiHandle image_handle, EfiSystemTable *st)
}
```

## Example

To compile and run the example, just execute `make run`
2 changes: 1 addition & 1 deletion src/console.c → console.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <tinyefi/tinyefi.h>
#include "efi.h"

void efi_console_reset(void)
{
Expand Down
2 changes: 1 addition & 1 deletion include/tinyefi/console.h → console.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TINYEFI_CONSOLE_H
#define TINYEFI_CONSOLE_H

#include <tinyefi/protos.h>
#include "protos.h"

void efi_console_reset(void);
void efi_console_set_attribute(uint64_t attribute);
Expand Down
4 changes: 2 additions & 2 deletions src/tinyefi.c → efi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <tinyefi/tinyefi.h>
#include <tinyefi/types.h>
#include "efi.h"
#include "types.h"

static EfiHandle _handle;
static EfiSystemTable *_st;
Expand Down
10 changes: 5 additions & 5 deletions include/tinyefi/tinyefi.h → efi.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef TINYEFI_TINYEFI_H
#define TINYEFI_TINYEFI_H
#ifndef TINYEFI_EFI_H
#define TINYEFI_EFI_H

#include <tinyefi/console.h>
#include <tinyefi/protos.h>
#include <tinyefi/tables.h>
#include "console.h"
#include "protos.h"
#include "tables.h"

void efi_init(EfiHandle handle, EfiSystemTable *st);

Expand Down
2 changes: 1 addition & 1 deletion example/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <tinyefi/tinyefi.h>
#include "../efi.h"

void __chkstk() { return; }

Expand Down
12 changes: 0 additions & 12 deletions include/tinyefi/protos.h

This file was deleted.

7 changes: 0 additions & 7 deletions include/tinyefi/services.h

This file was deleted.

7 changes: 0 additions & 7 deletions include/tinyefi/tables.h

This file was deleted.

6 changes: 6 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://schemas.cute.engineering/latest/osdk.manifest.component",
"id": "tiny-efi",
"type": "lib",
"description": "Tiny public domain EFI library"
}
12 changes: 12 additions & 0 deletions protos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef TINYEFI_PROTOS_H
#define TINYEFI_PROTOS_H

#include "protos/dpp.h"
#include "protos/fp.h"
#include "protos/gop.h"
#include "protos/lip.h"
#include "protos/sfsp.h"
#include "protos/stip.h"
#include "protos/stop.h"

#endif
2 changes: 1 addition & 1 deletion include/tinyefi/protos/dpp.h → protos/dpp.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TINYEFI_PROTOS_DPP_H
#define TINYEFI_PROTOS_DPP_H

#include <tinyefi/types.h>
#include "../types.h"

#define EFI_DPP_GUID \
(EfiGuid) \
Expand Down
2 changes: 1 addition & 1 deletion include/tinyefi/protos/fp.h → protos/fp.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TINYEFI_PROTOS_FP_H
#define TINYEFI_PROTOS_FP_H

#include <tinyefi/protos/dpp.h>
#include "../protos/dpp.h"

#define EFI_FILE_INFO_ID \
(EfiGuid) \
Expand Down
2 changes: 1 addition & 1 deletion include/tinyefi/protos/gop.h → protos/gop.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TINYEFI_PROTOS_GOP_H
#define TINYEFI_PROTOS_GOP_H

#include <tinyefi/types.h>
#include "../types.h"

#define EFI_GOP_GUID \
{ \
Expand Down
2 changes: 1 addition & 1 deletion include/tinyefi/protos/lip.h → protos/lip.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <tinyefi/tables/system.h>
#include "../tables/system.h"

#define EFI_LIP_GUID \
{ \
Expand Down
4 changes: 2 additions & 2 deletions include/tinyefi/protos/sfsp.h → protos/sfsp.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <tinyefi/protos/fp.h>
#include <tinyefi/types.h>
#include "../protos/fp.h"
#include "../types.h"

#define EFI_SFSP_REVISION 0x00010000

Expand Down
2 changes: 1 addition & 1 deletion include/tinyefi/protos/stip.h → protos/stip.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TINYEFI_PROTOS_STIP_H
#define TINYEFI_PROTOS_STIP_H

#include <tinyefi/types.h>
#include "../types.h"

#define CHAR_CARRIAGE_RETURN 0x000D

Expand Down
2 changes: 1 addition & 1 deletion include/tinyefi/protos/stop.h → protos/stop.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TINYEFI_PROTOS_STOP_H
#define TINYEFI_PROTOS_STOP_H

#include <tinyefi/types.h>
#include "../types.h"

#define EFI_STOP_GUID \
{ \
Expand Down
7 changes: 7 additions & 0 deletions services.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef TINYEFI_SERVICES_H
#define TINYEFI_SERVICES_H

#include "services/boot.h"
#include "services/runtime.h"

#endif
4 changes: 2 additions & 2 deletions include/tinyefi/services/boot.h → services/boot.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef TINYEFI_SERVICES_BOOT_H
#define TINYEFI_SERVICES_BOOT_H

#include <tinyefi/protos/dpp.h>
#include <tinyefi/types.h>
#include "../protos/dpp.h"
#include "../types.h"

/* Event Types */
#define EVT_TIMER 0x80000000
Expand Down
4 changes: 2 additions & 2 deletions include/tinyefi/services/runtime.h → services/runtime.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef TINYEFI_SERVICES_RUNTIME_H
#define TINYEFI_SERVICES_RUNTIME_H

#include <tinyefi/services/boot.h>
#include <tinyefi/types.h>
#include "../types.h"
#include "boot.h"

#define EFI_OPTIONAL_POINTER 0x00000001

Expand Down
7 changes: 7 additions & 0 deletions tables.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef TINYEFI_TABLES_H
#define TINYEFI_TABLES_H

#include "tables/config.h"
#include "tables/system.h"

#endif
2 changes: 1 addition & 1 deletion include/tinyefi/tables/config.h → tables/config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TINYEFI_TABLES_CONFIG_H
#define TINYEFI_TABLES_CONFIG_H

#include <tinyefi/types.h>
#include "../types.h"

#define ACPI2_TABLE_GUID \
{ \
Expand Down
10 changes: 5 additions & 5 deletions include/tinyefi/tables/system.h → tables/system.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef TINYEFI_TABLES_SYSTEM_H
#define TINYEFI_TABLES_SYSTEM_H

#include <tinyefi/protos/stip.h>
#include <tinyefi/protos/stop.h>
#include <tinyefi/services/boot.h>
#include <tinyefi/services/runtime.h>
#include <tinyefi/tables/config.h>
#include "../protos/stip.h"
#include "../protos/stop.h"
#include "../services/boot.h"
#include "../services/runtime.h"
#include "../tables/config.h"

typedef struct
{
Expand Down
File renamed without changes.

0 comments on commit 73aebd1

Please sign in to comment.