-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PureDOOM.h | ||
*.wad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#/bin/sh | ||
echo "Название: DOOM" | ||
echo "Лицензия: Публичное достояние" | ||
|
||
CC=${CC:-gcc} | ||
ARCH_FLAGS="-fno-stack-protector -ffreestanding -O0 -g -fPIC -static -nostdlib " | ||
|
||
if [ -d "../../sdk" ]; then | ||
CC="../../sdk/bin/x86_64-elf-gcc" | ||
fi | ||
|
||
wget https://github.com/Daivuk/PureDOOM/raw/refs/heads/master/PureDOOM.h | ||
wget https://github.com/Daivuk/PureDOOM/raw/refs/heads/master/doom1.wad | ||
|
||
$CC $ARCH_FLAGS -I../../modlib -finput-charset=UTF-8 -fexec-charset=cp1251 -c main.c -o doom.o | ||
$CC $ARCH_FLAGS -Wl,--entry=init,--build-id=none -T ../link.ld doom.o -L../../modlib/lib/ -lmod -o doom.ko | ||
|
||
cp doom.ko ../bin/ | ||
cp doom1.wad ../bin/ | ||
echo "Сборка завершена, файл: doom.ko" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "PureDOOM.h" | ||
#include <system.h> | ||
|
||
static const char name[] = "[APP]DOOM"; | ||
static const char message[] = "DOOM :)"; | ||
|
||
static int app_main( ) { | ||
log_printf("[%s]\n", message); | ||
return 2 + 2; | ||
} | ||
|
||
void __attribute__((section(".minit"))) init(env_t *env) { | ||
init_env(env); | ||
env->ret = &((module_info_t){ .name = (char *)&name, | ||
.message = (char *)&message, | ||
.type = 0, | ||
.data_size = 0, | ||
.data = (void *)&app_main, | ||
.err_code = 0, | ||
.module_id = 0, | ||
.irq = 0, | ||
.irq_handler = 0, | ||
.get_func = 0, | ||
.after_init = 0 }); | ||
mod_update_info(env); | ||
delete_thread( ); | ||
} |