mirror of https://gitlab.com/nakst/essence
refactor out system folder name
This commit is contained in:
parent
fdce1c19ce
commit
5d4b2caeb4
|
@ -655,7 +655,7 @@ EsError InstallGPT(EsBlockDeviceInformation driveInformation, EsMessageDevice dr
|
||||||
// Load the kernel.
|
// Load the kernel.
|
||||||
|
|
||||||
size_t kernelBytes;
|
size_t kernelBytes;
|
||||||
void *kernel = EsFileReadAll(EsLiteral(K_OS_FOLDER "/Kernel.esx"), &kernelBytes);
|
void *kernel = EsFileReadAll(EsLiteral(K_SYSTEM_FOLDER "/Kernel.esx"), &kernelBytes);
|
||||||
if (!kernel) return ES_ERROR_FILE_DOES_NOT_EXIST;
|
if (!kernel) return ES_ERROR_FILE_DOES_NOT_EXIST;
|
||||||
|
|
||||||
m.user.context1.u = 3;
|
m.user.context1.u = 3;
|
||||||
|
@ -832,7 +832,7 @@ EsError Install() {
|
||||||
void *kernel;
|
void *kernel;
|
||||||
|
|
||||||
if (useMBR) {
|
if (useMBR) {
|
||||||
kernel = EsFileReadAll(EsLiteral(K_OS_FOLDER "/Kernel.esx"), &kernelBytes);
|
kernel = EsFileReadAll(EsLiteral(K_SYSTEM_FOLDER "/Kernel.esx"), &kernelBytes);
|
||||||
if (!kernel) return ES_ERROR_FILE_DOES_NOT_EXIST;
|
if (!kernel) return ES_ERROR_FILE_DOES_NOT_EXIST;
|
||||||
m.user.context1.u = 6;
|
m.user.context1.u = 6;
|
||||||
EsMessagePost(nullptr, &m);
|
EsMessagePost(nullptr, &m);
|
||||||
|
@ -888,7 +888,7 @@ void InstallThread(EsGeneric) {
|
||||||
|
|
||||||
void WriteNewConfiguration() {
|
void WriteNewConfiguration() {
|
||||||
size_t newSystemConfigurationPathBytes, newSystemConfigurationBytes;
|
size_t newSystemConfigurationPathBytes, newSystemConfigurationBytes;
|
||||||
char *newSystemConfigurationPath = EsStringAllocateAndFormat(&newSystemConfigurationPathBytes, "%s/Essence/Default.ini",
|
char *newSystemConfigurationPath = EsStringAllocateAndFormat(&newSystemConfigurationPathBytes, "%s/" K_SYSTEM_FOLDER_NAME "/Default.ini",
|
||||||
newFileSystemMountPoint.prefixBytes, newFileSystemMountPoint.prefix);
|
newFileSystemMountPoint.prefixBytes, newFileSystemMountPoint.prefix);
|
||||||
char *newSystemConfiguration = (char *) EsFileReadAll(newSystemConfigurationPath, newSystemConfigurationPathBytes, &newSystemConfigurationBytes);
|
char *newSystemConfiguration = (char *) EsFileReadAll(newSystemConfigurationPath, newSystemConfigurationPathBytes, &newSystemConfigurationBytes);
|
||||||
|
|
||||||
|
|
|
@ -285,9 +285,10 @@ struct MemoryAvailable {
|
||||||
#define K_BOOT_DRIVE "0:"
|
#define K_BOOT_DRIVE "0:"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define K_OS_FOLDER K_BOOT_DRIVE "/Essence"
|
#define K_SYSTEM_FOLDER_NAME "Essence"
|
||||||
#define K_DESKTOP_EXECUTABLE K_OS_FOLDER "/Desktop.esx"
|
#define K_SYSTEM_FOLDER K_BOOT_DRIVE "/" K_SYSTEM_FOLDER_NAME
|
||||||
#define K_SYSTEM_CONFIGURATION K_OS_FOLDER "/Default.ini"
|
#define K_DESKTOP_EXECUTABLE K_SYSTEM_FOLDER "/Desktop.esx"
|
||||||
|
#define K_SYSTEM_CONFIGURATION K_SYSTEM_FOLDER "/Default.ini"
|
||||||
|
|
||||||
#define WINDOW_SET_BITS_NORMAL (0)
|
#define WINDOW_SET_BITS_NORMAL (0)
|
||||||
#define WINDOW_SET_BITS_SCROLL_HORIZONTAL (1)
|
#define WINDOW_SET_BITS_SCROLL_HORIZONTAL (1)
|
||||||
|
|
|
@ -196,7 +196,7 @@ const KDriver *DriverLoad(KInstalledDriver *installedDriver) {
|
||||||
if (!module) return nullptr;
|
if (!module) return nullptr;
|
||||||
|
|
||||||
module->path = buffer;
|
module->path = buffer;
|
||||||
module->pathBytes = EsStringFormat(buffer, K_MAX_PATH, K_OS_FOLDER "/Modules/%s.ekm",
|
module->pathBytes = EsStringFormat(buffer, K_MAX_PATH, K_SYSTEM_FOLDER "/Modules/%s.ekm",
|
||||||
installedDriver->nameBytes, installedDriver->name);
|
installedDriver->nameBytes, installedDriver->name);
|
||||||
module->resolveSymbol = ResolveKernelSymbol;
|
module->resolveSymbol = ResolveKernelSymbol;
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,6 @@ use_smart_quotes=1
|
||||||
enable_hover_state=1
|
enable_hover_state=1
|
||||||
enable_animations=1
|
enable_animations=1
|
||||||
|
|
||||||
[paths]
|
|
||||||
fonts=0:/Essence/Fonts
|
|
||||||
temporary=0:/Essence/Temporary
|
|
||||||
default_settings=0:/Essence/Settings
|
|
||||||
default_user_documents=0:/
|
|
||||||
|
|
||||||
[ui]
|
[ui]
|
||||||
font_fallback=Inter
|
font_fallback=Inter
|
||||||
font_sans=Inter
|
font_sans=Inter
|
||||||
|
|
|
@ -657,7 +657,7 @@ void BuildCrossCompiler() {
|
||||||
|
|
||||||
{
|
{
|
||||||
CallSystem("echo Preparing C standard library headers... >> bin/build_cross.log");
|
CallSystem("echo Preparing C standard library headers... >> bin/build_cross.log");
|
||||||
CallSystem("mkdir -p root/Essence root/Applications/POSIX/include root/Applications/POSIX/lib root/Applications/POSIX/bin");
|
CallSystem("mkdir -p root/" SYSTEM_FOLDER_NAME " root/Applications/POSIX/include root/Applications/POSIX/lib root/Applications/POSIX/bin");
|
||||||
CallSystem("ports/musl/build.sh >> bin/build_cross.log 2>&1");
|
CallSystem("ports/musl/build.sh >> bin/build_cross.log 2>&1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#define BINUTILS_VERSION "2.36.1"
|
#define BINUTILS_VERSION "2.36.1"
|
||||||
#define GCC_VERSION "11.1.0"
|
#define GCC_VERSION "11.1.0"
|
||||||
|
|
||||||
|
// Duplicated in prefix.h.
|
||||||
|
#define SYSTEM_FOLDER_NAME "Essence"
|
||||||
|
|
||||||
#ifndef OS_ESSENCE
|
#ifndef OS_ESSENCE
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
|
@ -580,7 +580,7 @@ void BuildDesktop(Application *application) {
|
||||||
ADD_BUNDLE_INPUT("res/Themes/elementary Icons License.txt", "Icons License.txt", 16);
|
ADD_BUNDLE_INPUT("res/Themes/elementary Icons License.txt", "Icons License.txt", 16);
|
||||||
ADD_BUNDLE_INPUT("bin/Desktop.no_symbols", "$Executables/x86_64", 0x1000);
|
ADD_BUNDLE_INPUT("bin/Desktop.no_symbols", "$Executables/x86_64", 0x1000);
|
||||||
|
|
||||||
MakeBundle("root/Essence/Desktop.esx", application->bundleInputFiles, arrlenu(application->bundleInputFiles), 0);
|
MakeBundle("root/" SYSTEM_FOLDER_NAME "/Desktop.esx", application->bundleInputFiles, arrlenu(application->bundleInputFiles), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildApplication(Application *application) {
|
void BuildApplication(Application *application) {
|
||||||
|
@ -776,7 +776,7 @@ void OutputSystemConfiguration() {
|
||||||
EsINIState s = {};
|
EsINIState s = {};
|
||||||
char *config = (char *) LoadFile("res/System Configuration Template.ini", &s.bytes);
|
char *config = (char *) LoadFile("res/System Configuration Template.ini", &s.bytes);
|
||||||
s.buffer = config;
|
s.buffer = config;
|
||||||
File file = FileOpen("root/Essence/Default.ini", 'w');
|
File file = FileOpen("root/" SYSTEM_FOLDER_NAME "/Default.ini", 'w');
|
||||||
|
|
||||||
while (EsINIParse(&s)) {
|
while (EsINIParse(&s)) {
|
||||||
EsINIZeroTerminate(&s);
|
EsINIZeroTerminate(&s);
|
||||||
|
@ -793,6 +793,12 @@ void OutputSystemConfiguration() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilePrintFormat(file, "\n[paths]\n");
|
||||||
|
FilePrintFormat(file, "fonts=0:/" SYSTEM_FOLDER_NAME "/Fonts\n");
|
||||||
|
FilePrintFormat(file, "temporary=0:/" SYSTEM_FOLDER_NAME "/Temporary\n");
|
||||||
|
FilePrintFormat(file, "default_settings=0:/" SYSTEM_FOLDER_NAME "/Settings\n");
|
||||||
|
FilePrintFormat(file, "default_user_documents=0:/\n");
|
||||||
|
|
||||||
for (uintptr_t i = 0; i < arrlenu(applications); i++) {
|
for (uintptr_t i = 0; i < arrlenu(applications); i++) {
|
||||||
if (!applications[i].install) {
|
if (!applications[i].install) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -833,7 +839,7 @@ void OutputSystemConfiguration() {
|
||||||
FilePrintFormat(file, "\n[@application %d]\n", applications[i].id);
|
FilePrintFormat(file, "\n[@application %d]\n", applications[i].id);
|
||||||
FilePrintFormat(file, "name=%s\n", applications[i].name);
|
FilePrintFormat(file, "name=%s\n", applications[i].name);
|
||||||
FilePrintFormat(file, "executable=0:/Applications/%s.esx\n", applications[i].name);
|
FilePrintFormat(file, "executable=0:/Applications/%s.esx\n", applications[i].name);
|
||||||
FilePrintFormat(file, "settings_path=0:/Essence/Settings/%s\n", applications[i].name);
|
FilePrintFormat(file, "settings_path=0:/" SYSTEM_FOLDER_NAME "/Settings/%s\n", applications[i].name);
|
||||||
|
|
||||||
for (uintptr_t j = 0; j < arrlenu(applications[i].properties); j++) {
|
for (uintptr_t j = 0; j < arrlenu(applications[i].properties); j++) {
|
||||||
FilePrintFormat(file, "%s=%s\n", applications[i].properties[j].key, applications[i].properties[j].value);
|
FilePrintFormat(file, "%s=%s\n", applications[i].properties[j].key, applications[i].properties[j].value);
|
||||||
|
@ -892,8 +898,8 @@ void BuildModule(Application *application) {
|
||||||
|
|
||||||
if (!application->builtin) {
|
if (!application->builtin) {
|
||||||
char target[4096];
|
char target[4096];
|
||||||
snprintf(target, sizeof(target), "root/Essence/Modules/%s.ekm", application->name);
|
snprintf(target, sizeof(target), "root/" SYSTEM_FOLDER_NAME "/Modules/%s.ekm", application->name);
|
||||||
MakeDirectory("root/Essence/Modules");
|
MakeDirectory("root/" SYSTEM_FOLDER_NAME "/Modules");
|
||||||
MoveFile(output, target);
|
MoveFile(output, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1047,7 +1053,7 @@ void LinkKernel() {
|
||||||
|
|
||||||
Execute(toolchainCXX, "-T", "util/linker/kernel64.ld", "-o", "bin/Kernel", "bin/kernel_symbols.o", "bin/kernel_all.o", "-mno-red-zone", ArgString(kernelLinkFlags));
|
Execute(toolchainCXX, "-T", "util/linker/kernel64.ld", "-o", "bin/Kernel", "bin/kernel_symbols.o", "bin/kernel_all.o", "-mno-red-zone", ArgString(kernelLinkFlags));
|
||||||
Execute(toolchainStrip, "-o", "bin/Kernel.esx", "--strip-all", "bin/Kernel");
|
Execute(toolchainStrip, "-o", "bin/Kernel.esx", "--strip-all", "bin/Kernel");
|
||||||
CopyFile("bin/Kernel.esx", "root/Essence/Kernel.esx", false);
|
CopyFile("bin/Kernel.esx", "root/" SYSTEM_FOLDER_NAME "/Kernel.esx", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildKernel(Application *application) {
|
void BuildKernel(Application *application) {
|
||||||
|
@ -1181,7 +1187,7 @@ void Install(const char *driveFile, uint64_t partitionSize, const char *partitio
|
||||||
// TODO Update this.
|
// TODO Update this.
|
||||||
#if 0
|
#if 0
|
||||||
if (convertFonts) {
|
if (convertFonts) {
|
||||||
ImportNode *fontsFolder = ImportNodeMakeDirectory(ImportNodeFindChild(&root, "Essence"), "Fonts");
|
ImportNode *fontsFolder = ImportNodeMakeDirectory(ImportNodeFindChild(&root, SYSTEM_FOLDER_NAME), "Fonts");
|
||||||
|
|
||||||
for (uintptr_t i = 0; i < arrlenu(fontLines); i++) {
|
for (uintptr_t i = 0; i < arrlenu(fontLines); i++) {
|
||||||
if (fontLines[i].key[0] == '.') {
|
if (fontLines[i].key[0] == '.') {
|
||||||
|
@ -1434,7 +1440,7 @@ int main(int argc, char **argv) {
|
||||||
MakeDirectory("root/Applications/POSIX/lib");
|
MakeDirectory("root/Applications/POSIX/lib");
|
||||||
MakeDirectory("root/Applications/POSIX/tmp");
|
MakeDirectory("root/Applications/POSIX/tmp");
|
||||||
MakeDirectory("root/Applications/POSIX/lib/linker");
|
MakeDirectory("root/Applications/POSIX/lib/linker");
|
||||||
MakeDirectory("root/Essence");
|
MakeDirectory("root/" SYSTEM_FOLDER_NAME);
|
||||||
|
|
||||||
if (!skipHeaderGeneration) {
|
if (!skipHeaderGeneration) {
|
||||||
HeaderGeneratorMain(1, NULL);
|
HeaderGeneratorMain(1, NULL);
|
||||||
|
|
Loading…
Reference in New Issue