diff --git a/.gitignore b/.gitignore index 7e7d56a7..7e83ac23 100644 --- a/.gitignore +++ b/.gitignore @@ -114,7 +114,14 @@ gradle-app.setting # Cache of project .gradletasknamecache -**/build/ +/*/build/ +/build/ +/*/.gradle/ +/.gradle/ + +/.idea/ +/.vscode/ +/.fleet/ # Common working directory run/ diff --git a/api/build.gradle.kts b/api/build.gradle.kts index afef51d6..37925a78 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -13,9 +13,6 @@ repositories { } dependencies { - testImplementation(platform("org.junit:junit-bom:5.10.0")) - testImplementation("org.junit.jupiter:junit-jupiter") - implementation("org.jetbrains:annotations:23.0.0") implementation("io.github.ultreon:ubo:1.3.0") diff --git a/common/src/api/java/dev/ultreon/devices/api/IO.java b/api/src/main/java/dev/ultreon/devices/api/IO.java similarity index 100% rename from common/src/api/java/dev/ultreon/devices/api/IO.java rename to api/src/main/java/dev/ultreon/devices/api/IO.java diff --git a/api/src/main/java/dev/ultreon/devices/api/TextureLoader.java b/api/src/main/java/dev/ultreon/devices/api/TextureLoader.java new file mode 100644 index 00000000..75d5f2d6 --- /dev/null +++ b/api/src/main/java/dev/ultreon/devices/api/TextureLoader.java @@ -0,0 +1,10 @@ +package dev.ultreon.devices.api; + +import java.io.IOException; +import java.io.InputStream; + +public interface TextureLoader { + int load(InputStream stream) throws IOException; + + void destroy(int textureID); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/device/AudioDevice.java b/api/src/main/java/dev/ultreon/devices/api/device/AudioDevice.java similarity index 100% rename from common/src/api/java/dev/ultreon/devices/api/device/AudioDevice.java rename to api/src/main/java/dev/ultreon/devices/api/device/AudioDevice.java diff --git a/common/src/api/java/dev/ultreon/devices/api/device/Device.java b/api/src/main/java/dev/ultreon/devices/api/device/Device.java similarity index 100% rename from common/src/api/java/dev/ultreon/devices/api/device/Device.java rename to api/src/main/java/dev/ultreon/devices/api/device/Device.java diff --git a/common/src/api/java/dev/ultreon/devices/api/device/Drive.java b/api/src/main/java/dev/ultreon/devices/api/device/Drive.java similarity index 100% rename from common/src/api/java/dev/ultreon/devices/api/device/Drive.java rename to api/src/main/java/dev/ultreon/devices/api/device/Drive.java diff --git a/common/src/api/java/dev/ultreon/devices/api/device/HardwareDevice.java b/api/src/main/java/dev/ultreon/devices/api/device/HardwareDevice.java similarity index 100% rename from common/src/api/java/dev/ultreon/devices/api/device/HardwareDevice.java rename to api/src/main/java/dev/ultreon/devices/api/device/HardwareDevice.java diff --git a/common/src/api/java/dev/ultreon/devices/api/device/MousePointer.java b/api/src/main/java/dev/ultreon/devices/api/device/MousePointer.java similarity index 100% rename from common/src/api/java/dev/ultreon/devices/api/device/MousePointer.java rename to api/src/main/java/dev/ultreon/devices/api/device/MousePointer.java diff --git a/common/src/api/java/dev/ultreon/devices/api/device/VEFI_Disk.java b/api/src/main/java/dev/ultreon/devices/api/device/VEFI_Disk.java similarity index 100% rename from common/src/api/java/dev/ultreon/devices/api/device/VEFI_Disk.java rename to api/src/main/java/dev/ultreon/devices/api/device/VEFI_Disk.java diff --git a/api/src/main/java/module-info.java b/api/src/main/java/module-info.java new file mode 100644 index 00000000..64ff3efc --- /dev/null +++ b/api/src/main/java/module-info.java @@ -0,0 +1,3 @@ +module devices.api { + requires java.base; +} \ No newline at end of file diff --git a/bios/build.gradle b/bios/build.gradle new file mode 100644 index 00000000..96f4aed9 --- /dev/null +++ b/bios/build.gradle @@ -0,0 +1,26 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.9.0' + +base { + archivesName = "devices-bios" +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + +repositories { + mavenCentral() +} + +dependencies { + implementation 'org.jetbrains:annotations:24.0.0' + + implementation project(':api') +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/Bios.java b/bios/src/main/java/dev/ultreon/vbios/Bios.java similarity index 73% rename from common/src/api/java/dev/ultreon/devices/api/bios/Bios.java rename to bios/src/main/java/dev/ultreon/vbios/Bios.java index a900e75c..fc440e9b 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/Bios.java +++ b/bios/src/main/java/dev/ultreon/vbios/Bios.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios; -import dev.ultreon.devices.api.bios.efi.VEFI_System; +import dev.ultreon.vbios.efi.VEFI_System; public interface Bios { void registerInterrupt(BiosInterruptType interrupt, InterruptHandler handler); diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/BiosCallType.java b/bios/src/main/java/dev/ultreon/vbios/BiosCallType.java similarity index 93% rename from common/src/api/java/dev/ultreon/devices/api/bios/BiosCallType.java rename to bios/src/main/java/dev/ultreon/vbios/BiosCallType.java index ec7f08df..010d3d00 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/BiosCallType.java +++ b/bios/src/main/java/dev/ultreon/vbios/BiosCallType.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios; -import dev.ultreon.devices.api.bios.efi.*; +import dev.ultreon.vbios.efi.*; public enum BiosCallType { POWER_OFF(void.class), diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/BiosInterruptType.java b/bios/src/main/java/dev/ultreon/vbios/BiosInterruptType.java similarity index 79% rename from common/src/api/java/dev/ultreon/devices/api/bios/BiosInterruptType.java rename to bios/src/main/java/dev/ultreon/vbios/BiosInterruptType.java index d6a9e4f8..cdfedc98 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/BiosInterruptType.java +++ b/bios/src/main/java/dev/ultreon/vbios/BiosInterruptType.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios; public enum BiosInterruptType { DOUBLE_FAULT, diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferCall.java b/bios/src/main/java/dev/ultreon/vbios/FrameBufferCall.java similarity index 97% rename from common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferCall.java rename to bios/src/main/java/dev/ultreon/vbios/FrameBufferCall.java index de6ac082..7f9c4aab 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferCall.java +++ b/bios/src/main/java/dev/ultreon/vbios/FrameBufferCall.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios; import java.nio.ByteBuffer; diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferInfo.java b/bios/src/main/java/dev/ultreon/vbios/FrameBufferInfo.java similarity index 68% rename from common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferInfo.java rename to bios/src/main/java/dev/ultreon/vbios/FrameBufferInfo.java index ecbccaa6..37897fe6 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferInfo.java +++ b/bios/src/main/java/dev/ultreon/vbios/FrameBufferInfo.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios; public record FrameBufferInfo( int width, diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/InterruptData.java b/bios/src/main/java/dev/ultreon/vbios/InterruptData.java similarity index 63% rename from common/src/api/java/dev/ultreon/devices/api/bios/InterruptData.java rename to bios/src/main/java/dev/ultreon/vbios/InterruptData.java index 1e5b1673..6ed9b497 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/InterruptData.java +++ b/bios/src/main/java/dev/ultreon/vbios/InterruptData.java @@ -1,7 +1,9 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios; public interface InterruptData { T getField(String name); void setField(String name, Object value); + + BiosInterruptType interruptType(); } diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/InterruptHandler.java b/bios/src/main/java/dev/ultreon/vbios/InterruptHandler.java similarity index 73% rename from common/src/api/java/dev/ultreon/devices/api/bios/InterruptHandler.java rename to bios/src/main/java/dev/ultreon/vbios/InterruptHandler.java index 0b6025a7..305479a7 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/InterruptHandler.java +++ b/bios/src/main/java/dev/ultreon/vbios/InterruptHandler.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios; @FunctionalInterface public interface InterruptHandler { diff --git a/bios/src/main/java/dev/ultreon/vbios/boot/BootSector.java b/bios/src/main/java/dev/ultreon/vbios/boot/BootSector.java new file mode 100644 index 00000000..4d17571e --- /dev/null +++ b/bios/src/main/java/dev/ultreon/vbios/boot/BootSector.java @@ -0,0 +1,7 @@ +package dev.ultreon.vbios.boot; + +import dev.ultreon.vbios.Bios; + +public interface BootSector { + void boot(Bios bios); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceID.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DeviceID.java similarity index 66% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceID.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DeviceID.java index 6de84b5e..49a79f87 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceID.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DeviceID.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; import java.util.UUID; diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceInfo.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DeviceInfo.java similarity index 57% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceInfo.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DeviceInfo.java index 2338d225..3c4b824a 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceInfo.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DeviceInfo.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; public record VEFI_DeviceInfo(VEFI_DeviceID[] ids) { diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DiskInfo.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DiskInfo.java similarity index 82% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DiskInfo.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DiskInfo.java index 9602fe9f..b2454242 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DiskInfo.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DiskInfo.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; public record VEFI_DiskInfo(VEFI_DeviceID deviceID, VEFI_DriveType driveType) { public VEFI_DiskInfo(VEFI_DeviceID deviceID, byte b) { diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DriveType.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DriveType.java similarity index 64% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DriveType.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DriveType.java index 53b06e28..da2f1983 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DriveType.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_DriveType.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; public enum VEFI_DriveType { HDD, diff --git a/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Executable.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Executable.java new file mode 100644 index 00000000..052fc289 --- /dev/null +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Executable.java @@ -0,0 +1,7 @@ +package dev.ultreon.vbios.efi; + +import dev.ultreon.vbios.Bios; + +public interface VEFI_Executable { + void execute(Bios bios, VEFI_System system); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_File.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_File.java similarity index 50% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_File.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_File.java index dd2e3bb8..ff042726 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_File.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_File.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; public record VEFI_File(int handle) { diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_FileInfo.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_FileInfo.java similarity index 60% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_FileInfo.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_FileInfo.java index 9a585b8b..70a03da8 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_FileInfo.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_FileInfo.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; public record VEFI_FileInfo(VEFI_DeviceID id, String path) { diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Handle.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Handle.java similarity index 56% rename from common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Handle.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Handle.java index 37a3f30c..4905033e 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Handle.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Handle.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios.efi; public record VEFI_Handle( int handle diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_IconType.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_IconType.java similarity index 73% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_IconType.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_IconType.java index 1881eaf7..a386510c 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_IconType.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_IconType.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; public enum VEFI_IconType { VEFI_Error, diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_Notification.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Notification.java similarity index 67% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_Notification.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Notification.java index 79fb785e..513a8518 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_Notification.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_Notification.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; public record VEFI_Notification(VEFI_IconType type, String header, String message) { } diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_System.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_System.java similarity index 77% rename from common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_System.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_System.java index 48441752..cf8b5861 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_System.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_System.java @@ -1,12 +1,13 @@ -package dev.ultreon.devices.api.bios.efi; +package dev.ultreon.vbios.efi; -import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.api.TextureLoader; +import dev.ultreon.vbios.Bios; import dev.ultreon.devices.api.device.VEFI_Disk; import org.intellij.lang.annotations.Language; import java.io.IOException; -public interface VEFI_System { +public interface VEFI_System extends TextureLoader { int F_READ = 0; int F_WRITE = 1; int F_EXEC = 2; @@ -74,11 +75,44 @@ public interface VEFI_System { void readFileB(VEFI_File file, byte[] data, int offset, int length); void readFileT(VEFI_File file, char[] data, int offset, int length); + /** + * Closes a file handle + * + * @param file the file to close + */ void closeFile(VEFI_File file); + /** + * Get the vBIOS instance. + * + * @return the vBIOS + */ Bios getBios(); - Object runIsolated(Class contex, @Language("jvm-class-name") String className, String packageName, Object... args); - + /** + * Run a class in an isolated context. + * + * @param context the context class, this is used to find the location in the classpath + * @param className the class name of the class to run in the context + * @param packageName the allowed package name that can be loaded. + * @param args the arguments to pass to the class. + * @return the instance of the class in the isolated context + */ + Object runIsolated(Class context, @Language("jvm-class-name") String className, String packageName, Object... args); + + /** + * Closes a disk after it is no longer in use. + * + * @param vefiDisk the vEFI disk to close + * @throws IOException if an I/O error occurs or if the disk is already closed + */ void closeDisk(VEFI_Disk vefiDisk) throws IOException; + + /** + * Offloads code to the vGPU thread. + * This is basically the Minecraft render thread. + * + * @param call the code to offload + */ + void offload(Runnable call); } diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_VideoSize.java b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_VideoSize.java similarity index 64% rename from common/src/api/java/dev/ultreon/devices/api/bios/VEFI_VideoSize.java rename to bios/src/main/java/dev/ultreon/vbios/efi/VEFI_VideoSize.java index 40f45430..3cd4285f 100644 --- a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_VideoSize.java +++ b/bios/src/main/java/dev/ultreon/vbios/efi/VEFI_VideoSize.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.vbios.efi; public record VEFI_VideoSize( int width, diff --git a/bios/src/main/java/module-info.java b/bios/src/main/java/module-info.java new file mode 100644 index 00000000..48a99ce7 --- /dev/null +++ b/bios/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module devices.bios { + requires devices.api; + requires java.base; +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index d7f5ec46..83e9d43b 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,6 @@ subprojects { url 'https://maven.quiltmc.org/repository/release/' } - maven { url "https://cursemaven.com" content { diff --git a/common/build.gradle b/common/build.gradle index 8a34ccd8..3c8ffd69 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -4,37 +4,12 @@ architectury { } sourceSets { - api { - java { - srcDirs += [ - "src/api/java" - ] - } - } - - mineos { - java { - srcDirs += [ - "src/mineos/java" - ] - } - - runtimeClasspath += sourceSets.api.output - compileClasspath += sourceSets.api.output - } - main { resources { srcDirs += [ "src/main/generated/resources" ] } - - runtimeClasspath += sourceSets.api.output - compileClasspath += sourceSets.api.output - - runtimeClasspath += sourceSets.mineos.output - compileClasspath += sourceSets.mineos.output } } @@ -46,10 +21,17 @@ repositories { maven { url = "https://cursemaven.com" } } +configurations { + osInstaller { + canBeConsumed = true + canBeResolved = true + } +} + dependencies { - apiImplementation 'org.jetbrains:annotations:24.0.0' - mineosImplementation 'org.jetbrains:annotations:24.0.0' - mineosImplementation "org.apache.commons:commons-compress:1.26.1" + implementation project(":api") + implementation project(":bios") + osInstaller project(":mineos:installer") // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies // Do NOT use other classes from fabric loader @@ -67,7 +49,14 @@ dependencies { modCompileOnly 'com.electronwill.night-config:core:3.6.3' modCompileOnly 'com.electronwill.night-config:toml:3.6.3' - implementation("de.waldheinz:fat32-lib:0.6.5") + implementation "de.waldheinz:fat32-lib:0.6.5" +} + +processResources { + from { + configurations.osInstaller + into "assets/devices/device_installers" + } } sourceSets { @@ -85,22 +74,6 @@ jar { from("LICENSE") { rename { "${it}_${archivesBaseName}" } } - - from(sourceSets.api.output) -} - -tasks.register("mineosJar", Jar) { - archiveBaseName = "MineOS" - archiveVersion = "1.0.0" - archiveClassifier = null - - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - - from("LICENSE") { - rename { "${it}_MineOS" } - } - - from(sourceSets.mineos.output) } publishing { diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Executable.java b/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Executable.java deleted file mode 100644 index eaea3d6f..00000000 --- a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Executable.java +++ /dev/null @@ -1,7 +0,0 @@ -package dev.ultreon.devices.api.bios; - -import dev.ultreon.devices.api.bios.efi.VEFI_System; - -public interface VEFI_Executable { - void execute(Bios bios, VEFI_System system); -} diff --git a/common/src/api/java/dev/ultreon/devices/api/boot/BootSector.java b/common/src/api/java/dev/ultreon/devices/api/boot/BootSector.java deleted file mode 100644 index 187df5c6..00000000 --- a/common/src/api/java/dev/ultreon/devices/api/boot/BootSector.java +++ /dev/null @@ -1,7 +0,0 @@ -package dev.ultreon.devices.api.boot; - -import dev.ultreon.devices.api.bios.Bios; - -public interface BootSector { - void boot(Bios bios); -} diff --git a/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java b/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java index 09db2da6..32062f41 100644 --- a/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java +++ b/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java @@ -1,12 +1,12 @@ package dev.ultreon.devices.api.os; -import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; +import dev.ultreon.vbios.efi.VEFI_DeviceID; import dev.ultreon.devices.client.Display; -import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.vbios.Bios; import dev.ultreon.mineos.object.AppInfo; import net.minecraft.client.gui.screens.Screen; import net.minecraft.nbt.CompoundTag; -import dev.ultreon.devices.api.bios.InterruptData; +import dev.ultreon.vbios.InterruptData; import net.minecraft.client.gui.GuiGraphics; import dev.ultreon.mineos.api.Application; diff --git a/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java b/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java index 0687a587..cff07600 100644 --- a/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java +++ b/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.core; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.vbios.Bios; import dev.ultreon.devices.impl.bios.BiosNotification; import dev.ultreon.devices.impl.bios.PowerModeInterrupt; import dev.ultreon.devices.impl.io.Drive; diff --git a/common/src/main/java/dev/ultreon/devices/core/BootLoader.java b/common/src/main/java/dev/ultreon/devices/core/BootLoader.java index 8b985b65..9b26052e 100644 --- a/common/src/main/java/dev/ultreon/devices/core/BootLoader.java +++ b/common/src/main/java/dev/ultreon/devices/core/BootLoader.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.core; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.vbios.Bios; import dev.ultreon.devices.api.os.OperatingSystem; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.architectury.extensions.injected.InjectedRegistryEntryExtension; diff --git a/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java b/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java index f87b0c3c..7725062f 100644 --- a/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java +++ b/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java @@ -1,9 +1,9 @@ package dev.ultreon.devices.core; -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.bios.BiosCallType; -import dev.ultreon.devices.api.bios.BiosInterruptType; -import dev.ultreon.devices.api.bios.InterruptHandler; +import dev.ultreon.vbios.Bios; +import dev.ultreon.vbios.BiosCallType; +import dev.ultreon.vbios.BiosInterruptType; +import dev.ultreon.vbios.InterruptHandler; import dev.ultreon.devices.impl.bios.BiosNotification; import dev.ultreon.devices.impl.bios.PowerModeInterrupt; import dev.ultreon.devices.impl.io.Drive; diff --git a/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java b/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java index e991d586..2c5d5b54 100644 --- a/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java +++ b/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.bios.efi.VEFI_IconType; -import dev.ultreon.devices.api.bios.efi.VEFI_Notification; +import dev.ultreon.vbios.efi.VEFI_IconType; +import dev.ultreon.vbios.efi.VEFI_Notification; import dev.ultreon.devices.impl.app.IIcon; import dev.ultreon.mineos.api.Icons; import dev.ultreon.devices.impl.utils.RenderUtil; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java b/common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java index e962b7ef..1fba2c87 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java @@ -1,14 +1,17 @@ package dev.ultreon.devices.impl.bios; -import dev.ultreon.devices.api.bios.InterruptData; +import dev.ultreon.vbios.BiosInterruptType; +import dev.ultreon.vbios.InterruptData; import java.lang.reflect.Field; public abstract class AbstractInterruptData implements InterruptData { private final VBios vbios; + private final BiosInterruptType interrupt; - public AbstractInterruptData(VBios vbios) { + public AbstractInterruptData(VBios vbios, BiosInterruptType interrupt) { this.vbios = vbios; + this.interrupt = interrupt; } @Override @@ -37,4 +40,9 @@ public void setField(String name, Object value) { vbios.fault(e); } } + + @Override + public BiosInterruptType interruptType() { + return interrupt; + } } diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java index ea26ba6e..c913c9b6 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.impl.bios; -import dev.ultreon.devices.api.bios.InterruptData; -import dev.ultreon.devices.api.bios.InterruptHandler; +import dev.ultreon.vbios.InterruptData; +import dev.ultreon.vbios.InterruptHandler; public class BiosInterruptCaller { public InterruptHandler handler; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java b/common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java index 8b283dbd..e1a4bdee 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.impl.bios; -import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; +import dev.ultreon.vbios.efi.VEFI_DeviceID; import java.util.ArrayList; import java.util.List; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java b/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java index e65a7050..9b13e8f9 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java @@ -1,8 +1,8 @@ package dev.ultreon.devices.impl.bios; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.bios.FrameBufferCall; -import dev.ultreon.devices.api.bios.FrameBufferInfo; +import dev.ultreon.vbios.FrameBufferCall; +import dev.ultreon.vbios.FrameBufferInfo; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.texture.AbstractTexture; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java b/common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java index 86cc03fa..58ea78b4 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.impl.bios; -import dev.ultreon.devices.api.bios.InterruptData; +import dev.ultreon.vbios.BiosInterruptType; import java.io.IOException; @@ -9,7 +9,7 @@ public class IOErrorInterrupt extends AbstractInterruptData { public final IOException e; public IOErrorInterrupt(VBios bios, VEFI_SystemImpl vefiSystem, IOException e) { - super(bios); + super(bios, BiosInterruptType.IO_ERROR); this.vefiSystem = vefiSystem; this.e = e; } diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java index 71084ea5..d71e82d3 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java @@ -4,11 +4,12 @@ import de.waldheinz.fs.*; import de.waldheinz.fs.fat.FatFileSystem; import dev.ultreon.devices.api.bios.*; -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.bios.InterruptData; -import dev.ultreon.devices.api.bios.efi.VEFI_DiskInfo; -import dev.ultreon.devices.api.bios.efi.VEFI_File; -import dev.ultreon.devices.api.bios.efi.VEFI_System; +import dev.ultreon.vbios.*; +import dev.ultreon.vbios.Bios; +import dev.ultreon.vbios.InterruptData; +import dev.ultreon.vbios.efi.VEFI_DiskInfo; +import dev.ultreon.vbios.efi.VEFI_File; +import dev.ultreon.vbios.efi.VEFI_System; import dev.ultreon.devices.api.device.HardwareDevice; import dev.ultreon.devices.api.device.VEFI_Disk; import dev.ultreon.devices.impl.device.HostDevice; @@ -23,10 +24,7 @@ import java.nio.channels.SeekableByteChannel; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; import static java.lang.Math.min; @@ -135,7 +133,7 @@ public Object call(BiosCallType call, Object[] args) { yield null; } case ENTER_SLEEP -> { - this.interrupt(BiosInterruptType.FRAMEBUFFER_INTERRUPT, new AbstractInterruptData(this) { + this.interrupt(new AbstractInterruptData(this, BiosInterruptType.FRAMEBUFFER_INTERRUPT) { @SuppressWarnings("unused") public final int type = FrameBuffer.DISABLE; }); @@ -144,7 +142,7 @@ public Object call(BiosCallType call, Object[] args) { yield null; } case EXIT_SLEEP -> { - this.interrupt(BiosInterruptType.FRAMEBUFFER_INTERRUPT, new AbstractInterruptData(this) { + this.interrupt(new AbstractInterruptData(this, BiosInterruptType.FRAMEBUFFER_INTERRUPT) { @SuppressWarnings("unused") public final int type = FrameBuffer.ENABLE; }); @@ -223,7 +221,8 @@ public VEFI_System getVEFISystem() { return this.system; } - public void interrupt(BiosInterruptType biosInterruptType, InterruptData data) { + public void interrupt(InterruptData data) { + BiosInterruptType biosInterruptType = data.interruptType(); if (biosInterruptType == BiosInterruptType.FAULT) { if (faults > 10) { this.reset(); @@ -247,15 +246,24 @@ private void powerDownImmediately() { } public void fault(Throwable e) { + if (faults > 10) this.reset(); + if (faults++ > 0) { + DoubleFaultInterrupt doubleFaultInterrupt = new DoubleFaultInterrupt(this); + doubleFaultInterrupt.errorCode = 1; + doubleFaultInterrupt.stackTrace = Arrays.stream(e.getStackTrace()).map(Object::toString).collect(Collectors.joining("\n")); + doubleFaultInterrupt.cause = e; + this.interrupt(doubleFaultInterrupt); + return; + } FaultInterrupt faultInterrupt = new FaultInterrupt(this); faultInterrupt.errorCode = 1; faultInterrupt.stackTrace = Arrays.stream(e.getStackTrace()).map(Object::toString).collect(Collectors.joining("\n")); faultInterrupt.cause = e; - this.interrupt(BiosInterruptType.FAULT, faultInterrupt); + this.interrupt(faultInterrupt); } public void requestPowerOff() { - this.interrupt(BiosInterruptType.POWER_BUTTON, new AbstractInterruptData(this) { + this.interrupt(new AbstractInterruptData(this, BiosInterruptType.POWER_BUTTON) { @SuppressWarnings("unused") public final int type = PB_POWER_OFF; }); @@ -320,7 +328,17 @@ private static class FaultInterrupt extends AbstractInterruptData { public @NullPtr Throwable cause; public FaultInterrupt(VBios vbios) { - super(vbios); + super(vbios, BiosInterruptType.FAULT); + } + } + + private static class DoubleFaultInterrupt extends AbstractInterruptData { + public int errorCode = 0; + public @NullPtr String stackTrace = ""; + public @NullPtr Throwable cause; + + public DoubleFaultInterrupt(VBios vbios) { + super(vbios, BiosInterruptType.DOUBLE_FAULT); } } diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java index 967b7fec..128f88a3 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.impl.bios; import de.waldheinz.fs.BlockDevice; -import dev.ultreon.devices.api.bios.efi.VEFI_File; +import dev.ultreon.vbios.efi.VEFI_File; import dev.ultreon.devices.api.device.HardwareDevice; import java.io.IOException; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java index fcaba322..f46fa573 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java @@ -1,14 +1,22 @@ package dev.ultreon.devices.impl.bios; +import com.mojang.blaze3d.platform.NativeImage; import de.waldheinz.fs.BlockDevice; -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.bios.BiosInterruptType; -import dev.ultreon.devices.api.bios.efi.*; +import dev.architectury.utils.Env; +import dev.architectury.utils.EnvExecutor; +import dev.ultreon.vbios.Bios; import dev.ultreon.devices.api.device.HardwareDevice; import dev.ultreon.devices.api.device.VEFI_Disk; import dev.ultreon.devices.core.client.ClientNotification; +import dev.ultreon.vbios.efi.*; +import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.DynamicTexture; import java.io.IOException; +import java.io.InputStream; import java.util.Arrays; import java.util.BitSet; import java.util.Map; @@ -25,6 +33,7 @@ public class VEFI_SystemImpl implements VEFI_System { private final VEFI_FileContext[] files = new VEFI_FileContext[128]; private final BitSet openDisks = new BitSet(32); final VEFI_DiskHandle[] disks = new VEFI_DiskHandle[32]; + private final Int2ObjectMap textures = new Int2ObjectArrayMap<>(); public VEFI_SystemImpl(DeviceInfo deviceInfo, VBios vBios) { this.deviceInfo = deviceInfo.createDeviceList(); @@ -338,7 +347,7 @@ public VEFI_Disk openDisk(VEFI_DiskInfo info) { try { this.loadPartitions(handle); } catch (IOException e) { - this.vBios.interrupt(BiosInterruptType.IO_ERROR, new IOErrorInterrupt(this.vBios, this, e)); + this.vBios.interrupt(new IOErrorInterrupt(this.vBios, this, e)); } } else { this.disks[i] = null; @@ -426,4 +435,28 @@ public void closeDisk(VEFI_Disk vefiDisk) throws IOException { disks[vefiDisk.handle()] = null; openDisks.clear(vefiDisk.handle()); } + + @Override + public void offload(Runnable call) { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> Minecraft.getInstance().submit(call)); + } + + @Override + public int load(InputStream stream) throws IOException { + NativeImage image = NativeImage.read(stream); + AbstractTexture texture = new DynamicTexture(image); + + this.textures.put(texture.getId(), texture); + + return texture.getId(); + } + + @Override + public void destroy(int textureID) { + AbstractTexture texture = this.textures.remove(textureID); + if (texture != null) { + texture.releaseId(); + texture.close(); + } + } } diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java index 968ade42..1c3b331b 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.impl.bios; -import dev.ultreon.devices.api.bios.FrameBufferCall; +import dev.ultreon.vbios.FrameBufferCall; import org.joml.Vector2i; public class VirtVGA { diff --git a/common/src/main/java/dev/ultreon/devices/item/InstallerFlashDriveItem.java b/common/src/main/java/dev/ultreon/devices/item/InstallerFlashDriveItem.java new file mode 100644 index 00000000..42661e67 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/item/InstallerFlashDriveItem.java @@ -0,0 +1,34 @@ +package dev.ultreon.devices.item; + +import dev.ultreon.vbios.efi.VEFI_Executable; +import dev.ultreon.devices.impl.bios.VirtualDisk; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.item.ItemStack; + +import java.nio.file.Path; + +public class InstallerFlashDriveItem extends FlashDriveItem { + public InstallerFlashDriveItem(DyeColor color, ResourceLocation resourceLocation) { + super(color); + + VirtualDisk disk = new VirtualDisk(Path.of("assets", resourceLocation.getNamespace(), "device_installers", resourceLocation.getPath() + ".jar")); + try { + disk.format(); + } catch (IOException e) { + throw new RuntimeException(e); + + FileStorageHandlers.register(this, ); + } + + public VEFI_Executable getExecutable() { + return executable; + } + + @Override + public ItemStack getDefaultInstance() { + ItemStack defaultInstance = super.getDefaultInstance(); + defaultInstance.getOrCreateTag().put("drive", ); + return defaultInstance; + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/BootLoader.java b/common/src/mineos/java/dev/ultreon/mineos/BootLoader.java deleted file mode 100644 index 809ea97d..00000000 --- a/common/src/mineos/java/dev/ultreon/mineos/BootLoader.java +++ /dev/null @@ -1,18 +0,0 @@ -package dev.ultreon.mineos; - -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.bios.VEFI_Executable; -import dev.ultreon.devices.api.bios.efi.VEFI_System; - -public class BootLoader implements VEFI_Executable { - private Object kernel; - - @Override - public void execute(Bios bios, VEFI_System system) { - kernel = system.runIsolated(BootLoader.class, "dev.ultreon.mineos.kernel.MineOSKernel", "dev.ultreon.devices.os.mineos"); - } - - public Object getKernel() { - return kernel; - } -} diff --git a/common/src/mineos/java/dev/ultreon/mineos/Executable.java b/common/src/mineos/java/dev/ultreon/mineos/Executable.java deleted file mode 100644 index 5d2a0205..00000000 --- a/common/src/mineos/java/dev/ultreon/mineos/Executable.java +++ /dev/null @@ -1,26 +0,0 @@ -package dev.ultreon.mineos; - -import dev.ultreon.mineos.kernel.Kern; -import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; -import org.apache.commons.compress.archivers.zip.ZipFile; - -import java.io.IOException; -import java.nio.file.Path; - -public class Executable { - private final ZipFile zipFile; - - public Executable(Path path) throws IOException { - this.zipFile = ZipFile.builder().setSeekableByteChannel(Kern.get().openChannel(path)).get(); - } - - public byte[] getClass(String name) throws ClassNotFoundException { - ZipArchiveEntry entry = zipFile.getEntry(name.replace('.', '/') + ".class"); - if (entry == null) return null; - try { - return zipFile.getInputStream(entry).readAllBytes(); - } catch (IOException e) { - throw new ClassNotFoundException(name, e); - } - } -} diff --git a/common/src/mineos/java/dev/ultreon/mineos/impl/DevicePermission.java b/common/src/mineos/java/dev/ultreon/mineos/impl/DevicePermission.java deleted file mode 100644 index abd27919..00000000 --- a/common/src/mineos/java/dev/ultreon/mineos/impl/DevicePermission.java +++ /dev/null @@ -1,9 +0,0 @@ -package dev.ultreon.mineos.impl; - -import dev.ultreon.mineos.kernel.Device; - -public class DevicePermission extends Permission { - public DevicePermission(Device device, String name) { - super(name); - } -} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/Kern.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/Kern.java deleted file mode 100644 index 67ab53b9..00000000 --- a/common/src/mineos/java/dev/ultreon/mineos/kernel/Kern.java +++ /dev/null @@ -1,22 +0,0 @@ -package dev.ultreon.mineos.kernel; - -import dev.ultreon.mineos.impl.Permission; - -import java.nio.channels.SeekableByteChannel; -import java.nio.file.Path; - -public interface Kern { - static Kern get() { - - } - - void requestShutdown() throws SecurityException; - - void requestReboot() throws SecurityException; - - void requestHalt() throws SecurityException; - - void askPermission(Permission permission, Mono callback) throws SecurityException; - - SeekableByteChannel openChannel(Path path); -} diff --git a/mineos/.gitignore b/mineos/.gitignore new file mode 100644 index 00000000..1549665e --- /dev/null +++ b/mineos/.gitignore @@ -0,0 +1,5 @@ +/.idea/ +/*/build/ +/.local/ +/.env +/local.* diff --git a/mineos/bootloader/build.gradle b/mineos/bootloader/build.gradle new file mode 100644 index 00000000..7bb3ef2e --- /dev/null +++ b/mineos/bootloader/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.9.0' + +repositories { + mavenCentral() +} + +dependencies { + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/mineos/bootloader/src/main/java/dev/ultreon/mods/Main.java b/mineos/bootloader/src/main/java/dev/ultreon/mods/Main.java new file mode 100644 index 00000000..cc11cbbb --- /dev/null +++ b/mineos/bootloader/src/main/java/dev/ultreon/mods/Main.java @@ -0,0 +1,7 @@ +package dev.ultreon.mods; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/mineos/build.gradle b/mineos/build.gradle new file mode 100644 index 00000000..79744b4c --- /dev/null +++ b/mineos/build.gradle @@ -0,0 +1,29 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.1.0' + +base { + archivesName = 'devices-mineos' +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + +repositories { + mavenCentral() + + maven { url "https://gitlab.com/api/v4/groups/9962021/-/packages/maven" } +} + +dependencies { + implementation project(":api") + + implementation "org.jetbrains:annotations:24.0.0" + implementation "org.apache.commons:commons-compress:1.26.1" +} diff --git a/mineos/desktop/.gitignore b/mineos/desktop/.gitignore new file mode 100644 index 00000000..1549665e --- /dev/null +++ b/mineos/desktop/.gitignore @@ -0,0 +1,5 @@ +/.idea/ +/*/build/ +/.local/ +/.env +/local.* diff --git a/mineos/desktop/build.gradle b/mineos/desktop/build.gradle new file mode 100644 index 00000000..fdba48fa --- /dev/null +++ b/mineos/desktop/build.gradle @@ -0,0 +1,33 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.9.0' + +repositories { + mavenCentral() + + maven { url "https://gitlab.com/api/v4/groups/9962021/-/packages/maven" } +} + +subprojects { + repositories { + mavenCentral() + + maven { url "https://gitlab.com/api/v4/groups/9962021/-/packages/maven" } + } +} + +dependencies { + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' +} + +test { + useJUnitPlatform() +} + +jar.enabled = false +processResources.enabled = false +compileJava.enabled = false \ No newline at end of file diff --git a/mineos/desktop/logon/build.gradle b/mineos/desktop/logon/build.gradle new file mode 100644 index 00000000..d6b22936 --- /dev/null +++ b/mineos/desktop/logon/build.gradle @@ -0,0 +1,22 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.9.0' + +repositories { + mavenCentral() +} + +dependencies { + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + + implementation project(":mineos:kernel:api") + implementation project(":mineos:desktop:registry-lib") +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/mineos/desktop/logon/src/main/java/dev/ultreon/minos/apps/logon/Main.java b/mineos/desktop/logon/src/main/java/dev/ultreon/minos/apps/logon/Main.java new file mode 100644 index 00000000..990eec56 --- /dev/null +++ b/mineos/desktop/logon/src/main/java/dev/ultreon/minos/apps/logon/Main.java @@ -0,0 +1,5 @@ +package dev.ultreon.minos.apps.logon; + +public class Main { + +} diff --git a/mineos/desktop/registry-lib/build.gradle b/mineos/desktop/registry-lib/build.gradle new file mode 100644 index 00000000..2df38dcf --- /dev/null +++ b/mineos/desktop/registry-lib/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.9.0' + +repositories { + mavenCentral() +} + +dependencies { + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + + implementation "dev.ultreon:ubo:1.4.0" +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/mineos/desktop/registry-lib/src/main/java/dev/ultreon/mineos/lib/registry/RegistryHive.java b/mineos/desktop/registry-lib/src/main/java/dev/ultreon/mineos/lib/registry/RegistryHive.java new file mode 100644 index 00000000..68c823c4 --- /dev/null +++ b/mineos/desktop/registry-lib/src/main/java/dev/ultreon/mineos/lib/registry/RegistryHive.java @@ -0,0 +1,5 @@ +package dev.ultreon.mineos.lib.registry; + +public class RegistryHive { + +} diff --git a/mineos/desktop/registry-lib/src/main/java/dev/ultreon/mineos/lib/registry/RegistryLib.java b/mineos/desktop/registry-lib/src/main/java/dev/ultreon/mineos/lib/registry/RegistryLib.java new file mode 100644 index 00000000..b3f50a2d --- /dev/null +++ b/mineos/desktop/registry-lib/src/main/java/dev/ultreon/mineos/lib/registry/RegistryLib.java @@ -0,0 +1,17 @@ +package dev.ultreon.mineos.lib.registry; + +public class RegistryLib { + private static RegistryLib instance = new RegistryLib(); + + private RegistryLib() { + + } + + public static RegistryLib get() { + return instance; + } + + public RegistryHive getHive(String name) { + + } +} diff --git a/mineos/installer/build.gradle b/mineos/installer/build.gradle new file mode 100644 index 00000000..2658e4e3 --- /dev/null +++ b/mineos/installer/build.gradle @@ -0,0 +1,91 @@ +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.nio.file.Paths +import java.nio.file.StandardOpenOption + +import static java.nio.charset.StandardCharsets.* +import static java.nio.file.StandardOpenOption.* + +plugins { + id 'java' +} + +group = 'dev.ultreon.devices.mineos' +version = '0.9.0' + +base { + archivesName = 'mineos-installer' +} + +repositories { + mavenCentral() +} + +configurations { + bootloader { + canBeConsumed = true + canBeResolved = true + } +} + +dependencies { + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + + bootloader project(":mineos:bootloader") + + compileOnly project(":mineos:kernel:api") +} + +jar { + archiveExtension.set("jar") + + from { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + } +} + +tasks.register("setup") { + doLast { + copy { + from configurations.bootloader.collect { it.isDirectory() ? it : zipTree(it) } + into "build/boot-image" + } + + copy { + from "src/res" + into "build/boot-image" + } + + copy { + from jar.archiveFile + into "build/boot-image/usr/bin" + + rename { "installer.jar" } + } + + copy { + from rootProject.file("LICENSE") + into "build/boot-image" + } + + Files.writeString(Paths.get("build/boot-image/boot/vefi/boot.json"), """ + { + "bootloader": "/usr/bin/installer.jar", + } + """.trim().toString(), UTF_8, CREATE, TRUNCATE_EXISTING) + } +} + +tasks.register("bootableMedium", Zip) { + from "build/boot-image" + destinationDirectory = file("build") + archiveFileName = "mineos-installer.bin" + archiveExtension = "bin" + + zip64 true +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/mineos/installer/src/main/java/dev/ultreon/mods/Main.java b/mineos/installer/src/main/java/dev/ultreon/mods/Main.java new file mode 100644 index 00000000..cc11cbbb --- /dev/null +++ b/mineos/installer/src/main/java/dev/ultreon/mods/Main.java @@ -0,0 +1,7 @@ +package dev.ultreon.mods; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/mineos/kernel/.gitignore b/mineos/kernel/.gitignore new file mode 100644 index 00000000..1549665e --- /dev/null +++ b/mineos/kernel/.gitignore @@ -0,0 +1,5 @@ +/.idea/ +/*/build/ +/.local/ +/.env +/local.* diff --git a/mineos/kernel/api/build.gradle b/mineos/kernel/api/build.gradle new file mode 100644 index 00000000..a18871f8 --- /dev/null +++ b/mineos/kernel/api/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.9.0' + +repositories { + mavenCentral() + + maven { url "https://gitlab.com/api/v4/groups/9962021/-/packages/maven" } + maven { url "https://jitpack.io" } + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } + maven { url "https://oss.sonatype.org/content/repositories/releases" } +} + +dependencies { + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + + // Project Reactor + implementation 'io.projectreactor:reactor-core:3.6.8' + + // Reactive Streams + implementation 'org.reactivestreams:reactive-streams:+' + implementation 'org.reactivestreams:reactive-streams-tck:+' +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/mineos/kernel/api/src/main/java/module-info.java b/mineos/kernel/api/src/main/java/module-info.java new file mode 100644 index 00000000..29098d18 --- /dev/null +++ b/mineos/kernel/api/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module mineos.kernel.api { + requires java.base; + requires reactor.core; +} \ No newline at end of file diff --git a/mineos/kernel/build.gradle b/mineos/kernel/build.gradle new file mode 100644 index 00000000..5cfa337a --- /dev/null +++ b/mineos/kernel/build.gradle @@ -0,0 +1,13 @@ +plugins { + +} + +subprojects { + group = 'dev.ultreon.devices.mineos' + version = '0.9.0' + + apply plugin: 'java' + repositories { + mavenCentral() + } +} \ No newline at end of file diff --git a/mineos/kernel/impl/build.gradle b/mineos/kernel/impl/build.gradle new file mode 100644 index 00000000..b7e45263 --- /dev/null +++ b/mineos/kernel/impl/build.gradle @@ -0,0 +1,22 @@ +plugins { + id 'java' +} + +group = 'dev.ultreon.mods' +version = '0.9.0' + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':mineos:kernel:api') + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' + + implementation project(":bios") +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/Device.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/Device.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/kernel/Device.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/Device.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/DriverManagerImpl.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/DriverManagerImpl.java similarity index 93% rename from common/src/mineos/java/dev/ultreon/mineos/DriverManagerImpl.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/DriverManagerImpl.java index fa5fc7ee..5f1a271b 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/DriverManagerImpl.java +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/DriverManagerImpl.java @@ -1,4 +1,6 @@ -package dev.ultreon.mineos; +package dev.ultreon.mineos.kernel; + +import dev.ultreon.mineos.kernel.driver.DriverManager; import java.util.Collection; import java.util.Map; diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/FrameBuffer.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/FrameBuffer.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/kernel/FrameBuffer.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/FrameBuffer.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/MineOSKernel.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/MineOSKernel.java similarity index 53% rename from common/src/mineos/java/dev/ultreon/mineos/kernel/MineOSKernel.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/MineOSKernel.java index a80954be..c03ea2af 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/kernel/MineOSKernel.java +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/MineOSKernel.java @@ -5,12 +5,20 @@ import dev.ultreon.devices.api.bios.FrameBufferCall; import dev.ultreon.devices.api.bios.FrameBufferInfo; import dev.ultreon.devices.impl.bios.Bios; +import dev.ultreon.mineos.AppClassLoader; import dev.ultreon.mineos.DriverManagerImpl; +import dev.ultreon.mineos.Executable; +import dev.ultreon.mineos.FSEntry; +import dev.ultreon.mineos.impl.Permission; +import dev.ultreon.mineos.userspace.FileSystem; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.sounds.SimpleSoundInstance; import net.minecraft.sounds.SoundEvent; import org.intellij.lang.annotations.Language; +import java.nio.channels.SeekableByteChannel; +import java.nio.file.Path; + public class MineOSKernel implements Kern { private static final DriverManagerImpl driverManager = new DriverManagerImpl(); @@ -18,8 +26,7 @@ public void boot(Bios bios) { bios.enableInterrupts(); this.loadDrivers(bios); - - this.enterUserspace(bios); + this.enterUserspace(bios, Path.of("/usr/bin/logon.jar")); } private void loadDrivers(Bios bios) { @@ -34,11 +41,12 @@ private void loadDrivers(Bios bios) { } } - private void enterUserspace(Bios bios) { + private void enterUserspace(Bios bios, Path mainPath) { @Language("jvm-class-name") final String className = "dev.ultreon.mineos.userspace.MineOS"; try { - bios.call(BiosCallType.ENTER_USERSPACE, new Object[] { className }); + AppClassLoader classLoader = new AppClassLoader(Thread.currentThread().getContextClassLoader(), new Executable(mainPath, this)); + classLoader.runMain(new String[]{}); } catch (Exception e) { throw new RuntimeException("Failed to enter userspace", e); } @@ -47,4 +55,49 @@ private void enterUserspace(Bios bios) { public void playSound(SoundEvent sound) { Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(sound, 1f, 1f)); } + + @Override + public void requestShutdown() throws SecurityException { + + } + + @Override + public void requestReboot() throws SecurityException { + + } + + @Override + public void requestHalt() throws SecurityException { + + } + + @Override + public void askPermission(Permission permission, Mono callback) throws SecurityException { + + } + + @Override + public SeekableByteChannel openChannel(Path path) { + return null; + } + + @Override + public void setFileSystem(FileSystem fileSystem) { + + } + + @Override + public FSEntry getFileInfo(Path path) { + return null; + } + + @Override + public SeekableByteChannel open(String path) { + return null; + } + + @Override + public void close(SeekableByteChannel channel) { + + } } diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/VGADriver.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/VGADriver.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/kernel/VGADriver.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/VGADriver.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/VideoDriver.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/VideoDriver.java similarity index 65% rename from common/src/mineos/java/dev/ultreon/mineos/kernel/VideoDriver.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/VideoDriver.java index 14a46b5b..8af1e3a6 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/kernel/VideoDriver.java +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/VideoDriver.java @@ -1,5 +1,7 @@ package dev.ultreon.mineos.kernel; +import dev.ultreon.mineos.kernel.driver.Driver; + public abstract class VideoDriver implements Driver { } diff --git a/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/FSEntry.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/FSEntry.java new file mode 100644 index 00000000..0ad2e151 --- /dev/null +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/FSEntry.java @@ -0,0 +1,9 @@ +package dev.ultreon.mineos.kernel.api; + +import java.nio.channels.SeekableByteChannel; + +public record FSEntry(String path) { + public SeekableByteChannel openChannel() { + return Kern.get().open(path); + } +} diff --git a/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/FileSystem.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/FileSystem.java new file mode 100644 index 00000000..c1b95639 --- /dev/null +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/FileSystem.java @@ -0,0 +1,19 @@ +package dev.ultreon.mineos.kernel.api; + +import java.nio.file.Path; + +public class FileSystem { + private static FileSystem instance = new FileSystem(); + + private FileSystem() { + Kern.get().setFileSystem(this); + } + + public FSEntry get(Path path) { + return Kern.get().getFileInfo(path); + } + + public static FileSystem get() { + return instance; + } +} diff --git a/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/InitOnce.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/InitOnce.java new file mode 100644 index 00000000..b00da7c3 --- /dev/null +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/InitOnce.java @@ -0,0 +1,22 @@ +package dev.ultreon.mineos.kernel.api; + +final class InitOnce { + private volatile boolean initialized = false; + + private Value value; + + public Value get() { + if (!initialized) { + throw new UnintializedValueException(); + } + return value; + } + + public void init(Value value) { + if (!initialized) { + initialized = true; + } + + this.value = value; + } +} diff --git a/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/Kern.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/Kern.java new file mode 100644 index 00000000..9fd95e38 --- /dev/null +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/Kern.java @@ -0,0 +1,32 @@ +package dev.ultreon.mineos.kernel.api; + +import reactor.core.publisher.Mono; + +import java.nio.channels.SeekableByteChannel; +import java.nio.file.Path; + +public interface Kern { + InitOnce INSTANCE = new InitOnce<>(); + + static Kern get() { + return INSTANCE.get(); + } + + void requestShutdown() throws SecurityException; + + void requestReboot() throws SecurityException; + + void requestHalt() throws SecurityException; + + void askPermission(Permission permission, Mono callback) throws SecurityException; + + SeekableByteChannel openChannel(Path path); + + void setFileSystem(FileSystem fileSystem); + + FSEntry getFileInfo(Path path); + + SeekableByteChannel open(String path); + + void close(SeekableByteChannel channel); +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/impl/Permission.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/Permission.java similarity index 82% rename from common/src/mineos/java/dev/ultreon/mineos/impl/Permission.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/Permission.java index 5de224ae..b3070288 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/impl/Permission.java +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/Permission.java @@ -1,4 +1,4 @@ -package dev.ultreon.mineos.impl; +package dev.ultreon.mineos.kernel.api; public class Permission { private final String name; diff --git a/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/PermissionTicket.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/PermissionTicket.java new file mode 100644 index 00000000..12b6d627 --- /dev/null +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/PermissionTicket.java @@ -0,0 +1,5 @@ +package dev.ultreon.mineos.kernel.api; + +public interface PermissionTicket { + boolean hasPermission(Permission permission); +} diff --git a/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/UnintializedValueException.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/UnintializedValueException.java new file mode 100644 index 00000000..297182d1 --- /dev/null +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/api/UnintializedValueException.java @@ -0,0 +1,11 @@ +package dev.ultreon.mineos.kernel.api; + +public class UnintializedValueException extends RuntimeException { + public UnintializedValueException() { + super("Value uninitialized"); + } + + public UnintializedValueException(String message) { + super(message); + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/Driver.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/driver/Driver.java similarity index 89% rename from common/src/mineos/java/dev/ultreon/mineos/kernel/Driver.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/driver/Driver.java index 08d9fb59..80a1a322 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/kernel/Driver.java +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/driver/Driver.java @@ -1,4 +1,4 @@ -package dev.ultreon.mineos.kernel; +package dev.ultreon.mineos.kernel.driver; import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; import dev.ultreon.devices.api.bios.efi.VEFI_DeviceInfo; diff --git a/common/src/mineos/java/dev/ultreon/mineos/DriverManager.java b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/driver/DriverManager.java similarity index 82% rename from common/src/mineos/java/dev/ultreon/mineos/DriverManager.java rename to mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/driver/DriverManager.java index 281d0895..60c1cdc6 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/DriverManager.java +++ b/mineos/kernel/impl/src/main/java/dev/ultreon/mineos/kernel/driver/DriverManager.java @@ -1,4 +1,4 @@ -package dev.ultreon.mineos; +package dev.ultreon.mineos.kernel.driver; import java.util.Collection; diff --git a/mineos/kernel/impl/src/main/java/module-info.java b/mineos/kernel/impl/src/main/java/module-info.java new file mode 100644 index 00000000..b1f08ff3 --- /dev/null +++ b/mineos/kernel/impl/src/main/java/module-info.java @@ -0,0 +1,7 @@ +module mineos.kernel.impl { + requires mineos.kernel.api; + requires devices.bios; + requires java.base; + + exports dev.ultreon.mineos.kernel.api; +} \ No newline at end of file diff --git a/mineos/kernel/src/main/java/dev/ultreon/mods/Main.java b/mineos/kernel/src/main/java/dev/ultreon/mods/Main.java new file mode 100644 index 00000000..cc11cbbb --- /dev/null +++ b/mineos/kernel/src/main/java/dev/ultreon/mods/Main.java @@ -0,0 +1,7 @@ +package dev.ultreon.mods; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/common/src/mineos/java/dev/ultreon/mineos/AppClassLoader.java b/mineos/src/main/java/dev/ultreon/mineos/AppClassLoader.java similarity index 80% rename from common/src/mineos/java/dev/ultreon/mineos/AppClassLoader.java rename to mineos/src/main/java/dev/ultreon/mineos/AppClassLoader.java index dd9be457..a5cfbabd 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/AppClassLoader.java +++ b/mineos/src/main/java/dev/ultreon/mineos/AppClassLoader.java @@ -1,5 +1,7 @@ package dev.ultreon.mineos; +import dev.ultreon.mineos.kernel.Kern; + import java.io.IOError; import java.io.IOException; import java.util.HashMap; @@ -38,4 +40,16 @@ protected Class findClass(String name) throws ClassNotFoundException { classes.put(name, definedClass); return definedClass; } + + public Kern getKern() { + return this.executable.getKern(); + } + + public void runMain(String[] args) { + try { + this.executable.run(this, args); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/mineos/src/main/java/dev/ultreon/mineos/BootLoader.java b/mineos/src/main/java/dev/ultreon/mineos/BootLoader.java new file mode 100644 index 00000000..3a94a3f6 --- /dev/null +++ b/mineos/src/main/java/dev/ultreon/mineos/BootLoader.java @@ -0,0 +1,32 @@ +package dev.ultreon.mineos; + +import dev.ultreon.devices.api.bios.*; +import dev.ultreon.devices.api.bios.efi.VEFI_System; + +public class BootLoader implements VEFI_Executable, InterruptHandler { + private Object kernel = null; + private Texture texture = null; + + @Override + public void execute(Bios bios, VEFI_System system) { + kernel = system.runIsolated(BootLoader.class, "dev.ultreon.mineos.kernel.MineOSKernel", "dev.ultreon.devices.os.mineos"); + + system.offload(() -> { + this.texture = new Texture(BootLoader.class.getResourceAsStream("/mineos.png")); + this.texture.load(system); + }); + + system.getBios().registerInterrupt(BiosInterruptType.FRAMEBUFFER_INTERRUPT, this); + } + + public Object getKernel() { + return kernel; + } + + @Override + public void onInterrupt(InterruptData interrupt) { + if (interrupt.interruptType() == BiosInterruptType.FRAMEBUFFER_INTERRUPT) { + texture.render(); + } + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/DestFactor.java b/mineos/src/main/java/dev/ultreon/mineos/DestFactor.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/DestFactor.java rename to mineos/src/main/java/dev/ultreon/mineos/DestFactor.java diff --git a/mineos/src/main/java/dev/ultreon/mineos/Executable.java b/mineos/src/main/java/dev/ultreon/mineos/Executable.java new file mode 100644 index 00000000..32bde9aa --- /dev/null +++ b/mineos/src/main/java/dev/ultreon/mineos/Executable.java @@ -0,0 +1,64 @@ +package dev.ultreon.mineos; + +import dev.ultreon.mineos.kernel.Kern; +import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; +import org.apache.commons.compress.archivers.zip.ZipFile; + +import java.io.IOException; +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.Properties; + +public class Executable { + private final ZipFile zipFile; + private final String mainClass; + private final Kern kern; + + public Executable(Path path, Kern kern) throws IOException { + this.zipFile = ZipFile.builder().setSeekableByteChannel(Kern.get().openChannel(path)).get(); + this.kern = kern; + + ZipArchiveEntry entry = zipFile.getEntry("META-INF/MANIFEST.MF"); + if (entry == null) throw new IllegalArgumentException("Invalid executable"); + try { + byte[] manifestAttrs = zipFile.getInputStream(entry).readAllBytes(); + if (manifestAttrs.length == 0) throw new IllegalArgumentException("Invalid executable"); + String manifest = new String(manifestAttrs, StandardCharsets.UTF_8); + if (!manifest.startsWith("Manifest-Version: 1.0")) throw new IllegalArgumentException("Invalid executable"); + + Properties properties = new Properties(); + properties.load(new StringReader(manifest)); + + String mainClass = properties.getProperty("Main-Class"); + if (mainClass == null) throw new IllegalArgumentException("Main entry point not found!"); + + this.mainClass = mainClass; + } catch (IOException e) { + throw new IllegalArgumentException("Invalid executable", e); + } + } + + public byte[] getClass(String name) throws ClassNotFoundException { + ZipArchiveEntry entry = zipFile.getEntry(name.replace('.', '/') + ".class"); + if (entry == null) return null; + try { + return zipFile.getInputStream(entry).readAllBytes(); + } catch (IOException e) { + throw new ClassNotFoundException(name, e); + } + } + + public void run(AppClassLoader classLoader, String[] args) { + try { + Class clazz = Class.forName(mainClass, true, classLoader); + clazz.getMethod("main", String[].class).invoke(null, (Object) args); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public Kern getKern() { + return kern; + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/MineOSSystem.java b/mineos/src/main/java/dev/ultreon/mineos/MineOSSystem.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/MineOSSystem.java rename to mineos/src/main/java/dev/ultreon/mineos/MineOSSystem.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/SourceFactor.java b/mineos/src/main/java/dev/ultreon/mineos/SourceFactor.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/SourceFactor.java rename to mineos/src/main/java/dev/ultreon/mineos/SourceFactor.java diff --git a/mineos/src/main/java/dev/ultreon/mineos/Texture.java b/mineos/src/main/java/dev/ultreon/mineos/Texture.java new file mode 100644 index 00000000..a028a0f7 --- /dev/null +++ b/mineos/src/main/java/dev/ultreon/mineos/Texture.java @@ -0,0 +1,26 @@ +package dev.ultreon.mineos; + +import dev.ultreon.devices.api.TextureLoader; + +import java.io.InputStream; + +public class Texture { + private final InputStream stream; + private int id; + + public Texture(InputStream stream) { + this.stream = stream; + } + + public void load(TextureLoader loader) { + this.id = loader.load(stream); + } + + public int getId() { + return id; + } + + public void dispose(TextureLoader loader) { + loader.destroy(id); + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/Alphabet.java b/mineos/src/main/java/dev/ultreon/mineos/api/Alphabet.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/Alphabet.java rename to mineos/src/main/java/dev/ultreon/mineos/api/Alphabet.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/Application.java b/mineos/src/main/java/dev/ultreon/mineos/api/Application.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/Application.java rename to mineos/src/main/java/dev/ultreon/mineos/api/Application.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/Component.java b/mineos/src/main/java/dev/ultreon/mineos/api/Component.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/Component.java rename to mineos/src/main/java/dev/ultreon/mineos/api/Component.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/Dialog.java b/mineos/src/main/java/dev/ultreon/mineos/api/Dialog.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/Dialog.java rename to mineos/src/main/java/dev/ultreon/mineos/api/Dialog.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/Icons.java b/mineos/src/main/java/dev/ultreon/mineos/api/Icons.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/Icons.java rename to mineos/src/main/java/dev/ultreon/mineos/api/Icons.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/Layout.java b/mineos/src/main/java/dev/ultreon/mineos/api/Layout.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/Layout.java rename to mineos/src/main/java/dev/ultreon/mineos/api/Layout.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/Notification.java b/mineos/src/main/java/dev/ultreon/mineos/api/Notification.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/Notification.java rename to mineos/src/main/java/dev/ultreon/mineos/api/Notification.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/ScrollableLayout.java b/mineos/src/main/java/dev/ultreon/mineos/api/ScrollableLayout.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/ScrollableLayout.java rename to mineos/src/main/java/dev/ultreon/mineos/api/ScrollableLayout.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/System.java b/mineos/src/main/java/dev/ultreon/mineos/api/System.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/System.java rename to mineos/src/main/java/dev/ultreon/mineos/api/System.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/SystemAccessor.java b/mineos/src/main/java/dev/ultreon/mineos/api/SystemAccessor.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/api/SystemAccessor.java rename to mineos/src/main/java/dev/ultreon/mineos/api/SystemAccessor.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/BoatRacersApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/BoatRacersApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/BoatRacersApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/BoatRacersApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/IconsApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/IconsApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/IconsApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/IconsApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/NoteStashApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/NoteStashApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/NoteStashApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/NoteStashApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/PixelPainterApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/PixelPainterApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/PixelPainterApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/PixelPainterApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/TestApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/TestApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/TestApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/TestApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/auction/AuctionManager.java b/mineos/src/main/java/dev/ultreon/mineos/apps/auction/AuctionManager.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/auction/AuctionManager.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/auction/AuctionManager.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/auction/MineBayApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/auction/MineBayApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/auction/MineBayApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/auction/MineBayApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/auction/object/AuctionItem.java b/mineos/src/main/java/dev/ultreon/mineos/apps/auction/object/AuctionItem.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/auction/object/AuctionItem.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/auction/object/AuctionItem.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskAddAuction.java b/mineos/src/main/java/dev/ultreon/mineos/apps/auction/task/TaskAddAuction.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskAddAuction.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/auction/task/TaskAddAuction.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskBuyItem.java b/mineos/src/main/java/dev/ultreon/mineos/apps/auction/task/TaskBuyItem.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskBuyItem.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/auction/task/TaskBuyItem.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskGetAuctions.java b/mineos/src/main/java/dev/ultreon/mineos/apps/auction/task/TaskGetAuctions.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskGetAuctions.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/auction/task/TaskGetAuctions.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/debug/TextAreaApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/debug/TextAreaApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/debug/TextAreaApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/debug/TextAreaApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/EmailApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/EmailApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailManager.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/EmailManager.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailManager.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/EmailManager.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Contact.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/object/Contact.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Contact.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/object/Contact.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Email.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/object/Email.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Email.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/object/Email.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskCheckEmailAccount.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskCheckEmailAccount.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskCheckEmailAccount.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskCheckEmailAccount.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskDeleteEmail.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskDeleteEmail.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskDeleteEmail.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskDeleteEmail.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskRegisterEmailAccount.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskRegisterEmailAccount.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskRegisterEmailAccount.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskRegisterEmailAccount.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskSendEmail.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskSendEmail.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskSendEmail.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskSendEmail.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskUpdateInbox.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskUpdateInbox.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskUpdateInbox.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskUpdateInbox.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskViewEmail.java b/mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskViewEmail.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskViewEmail.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/email/task/TaskViewEmail.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/example/ExampleApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/example/ExampleApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/example/ExampleApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/example/ExampleApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/example/task/TaskNotificationTest.java b/mineos/src/main/java/dev/ultreon/mineos/apps/example/task/TaskNotificationTest.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/example/task/TaskNotificationTest.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/example/task/TaskNotificationTest.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/GitWebApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/GitWebApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/GitWebApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/GitWebApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/GitWebFrame.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/GitWebFrame.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/GitWebFrame.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/GitWebFrame.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/AnvilBox.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/AnvilBox.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/AnvilBox.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/AnvilBox.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/BrewingBox.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/BrewingBox.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/BrewingBox.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/BrewingBox.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/ContainerBox.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/ContainerBox.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/ContainerBox.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/ContainerBox.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/CraftingBox.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/CraftingBox.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/CraftingBox.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/CraftingBox.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/FurnaceBox.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/FurnaceBox.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/FurnaceBox.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/FurnaceBox.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/LoomBox.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/LoomBox.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/LoomBox.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/component/container/LoomBox.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/ModuleLayout.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/layout/ModuleLayout.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/ModuleLayout.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/layout/ModuleLayout.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/TextLayout.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/layout/TextLayout.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/TextLayout.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/layout/TextLayout.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AnvilModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/AnvilModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AnvilModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/AnvilModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AppLinkModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/AppLinkModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AppLinkModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/AppLinkModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerIIModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/BannerIIModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerIIModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/BannerIIModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/BannerModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/BannerModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BrewingModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/BrewingModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BrewingModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/BrewingModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ContainerModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ContainerModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ContainerModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ContainerModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/CraftingModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/CraftingModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/CraftingModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/CraftingModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DividerModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/DividerModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DividerModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/DividerModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DownloadModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/DownloadModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DownloadModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/DownloadModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FooterModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/FooterModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FooterModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/FooterModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FurnaceModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/FurnaceModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FurnaceModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/FurnaceModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/HeaderModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/HeaderModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/HeaderModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/HeaderModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/LoomModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/LoomModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/LoomModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/LoomModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/Module.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/Module.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/Module.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/Module.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ModuleEntry.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ModuleEntry.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ModuleEntry.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ModuleEntry.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/NavigationModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/NavigationModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/NavigationModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/NavigationModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ParagraphModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ParagraphModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ParagraphModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ParagraphModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/RedirectModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/RedirectModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/RedirectModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/RedirectModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ScriptModule.java b/mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ScriptModule.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ScriptModule.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/gitweb/module/ScriptModule.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/snake/SnakeApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/snake/SnakeApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/snake/SnakeApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/snake/SnakeApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/snake/layout/SnakeLayout.java b/mineos/src/main/java/dev/ultreon/mineos/apps/snake/layout/SnakeLayout.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/snake/layout/SnakeLayout.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/snake/layout/SnakeLayout.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/AppStore.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/AppStore.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/AppStore.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/AppStore.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/BankApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/BankApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/BankApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/BankApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/DiagnosticsApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/DiagnosticsApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/DiagnosticsApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/DiagnosticsApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/DisplayResolution.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/DisplayResolution.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/DisplayResolution.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/DisplayResolution.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/FileBrowserApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/FileBrowserApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/FileBrowserApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/FileBrowserApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/PredefinedResolution.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/PredefinedResolution.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/PredefinedResolution.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/PredefinedResolution.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/SettingsApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/SettingsApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/SettingsApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/SettingsApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/SystemApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/SystemApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/SystemApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/SystemApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/VulnerabilityApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/VulnerabilityApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/VulnerabilityApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/VulnerabilityApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/AppGrid.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/component/AppGrid.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/component/AppGrid.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/component/AppGrid.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/FileBrowser.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/component/FileBrowser.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/component/FileBrowser.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/component/FileBrowser.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/Palette.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/component/Palette.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/component/Palette.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/component/Palette.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/SlideShow.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/component/SlideShow.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/component/SlideShow.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/component/SlideShow.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutAppPage.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/layout/LayoutAppPage.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutAppPage.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/layout/LayoutAppPage.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutSearchApps.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/layout/LayoutSearchApps.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutSearchApps.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/layout/LayoutSearchApps.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/StandardLayout.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/layout/StandardLayout.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/StandardLayout.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/layout/StandardLayout.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Account.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/Account.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Account.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/Account.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/AppEntry.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/AppEntry.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/AppEntry.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/AppEntry.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorScheme.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ColorScheme.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorScheme.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ColorScheme.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresetRegistry.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresetRegistry.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresetRegistry.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresetRegistry.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresets.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresets.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresets.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresets.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ImageEntry.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ImageEntry.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ImageEntry.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/ImageEntry.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/LocalEntry.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/LocalEntry.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/LocalEntry.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/LocalEntry.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Preset.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/Preset.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Preset.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/Preset.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/RemoteEntry.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/object/RemoteEntry.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/object/RemoteEntry.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/object/RemoteEntry.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskAdd.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskAdd.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskAdd.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskAdd.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskDeposit.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskDeposit.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskDeposit.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskDeposit.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskGetBalance.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskGetBalance.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskGetBalance.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskGetBalance.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskPay.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskPay.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskPay.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskPay.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskRemove.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskRemove.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskRemove.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskRemove.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateApplicationData.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskUpdateApplicationData.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateApplicationData.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskUpdateApplicationData.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateSystemData.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskUpdateSystemData.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateSystemData.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskUpdateSystemData.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskWithdraw.java b/mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskWithdraw.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskWithdraw.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/system/task/TaskWithdraw.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/apps/themes/ThemesApp.java b/mineos/src/main/java/dev/ultreon/mineos/apps/themes/ThemesApp.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/apps/themes/ThemesApp.java rename to mineos/src/main/java/dev/ultreon/mineos/apps/themes/ThemesApp.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/AppInfo.java b/mineos/src/main/java/dev/ultreon/mineos/object/AppInfo.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/AppInfo.java rename to mineos/src/main/java/dev/ultreon/mineos/object/AppInfo.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/ApplicationID.java b/mineos/src/main/java/dev/ultreon/mineos/object/ApplicationID.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/ApplicationID.java rename to mineos/src/main/java/dev/ultreon/mineos/object/ApplicationID.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/Canvas.java b/mineos/src/main/java/dev/ultreon/mineos/object/Canvas.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/Canvas.java rename to mineos/src/main/java/dev/ultreon/mineos/object/Canvas.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/ColorGrid.java b/mineos/src/main/java/dev/ultreon/mineos/object/ColorGrid.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/ColorGrid.java rename to mineos/src/main/java/dev/ultreon/mineos/object/ColorGrid.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/Game.java b/mineos/src/main/java/dev/ultreon/mineos/object/Game.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/Game.java rename to mineos/src/main/java/dev/ultreon/mineos/object/Game.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/Picture.java b/mineos/src/main/java/dev/ultreon/mineos/object/Picture.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/Picture.java rename to mineos/src/main/java/dev/ultreon/mineos/object/Picture.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/Player.java b/mineos/src/main/java/dev/ultreon/mineos/object/Player.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/Player.java rename to mineos/src/main/java/dev/ultreon/mineos/object/Player.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/TileGrid.java b/mineos/src/main/java/dev/ultreon/mineos/object/TileGrid.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/TileGrid.java rename to mineos/src/main/java/dev/ultreon/mineos/object/TileGrid.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/Tool.java b/mineos/src/main/java/dev/ultreon/mineos/object/Tool.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/Tool.java rename to mineos/src/main/java/dev/ultreon/mineos/object/Tool.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/TrayItem.java b/mineos/src/main/java/dev/ultreon/mineos/object/TrayItem.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/TrayItem.java rename to mineos/src/main/java/dev/ultreon/mineos/object/TrayItem.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tiles/Tile.java b/mineos/src/main/java/dev/ultreon/mineos/object/tiles/Tile.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tiles/Tile.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tiles/Tile.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileBlock.java b/mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileBlock.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileBlock.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileBlock.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileCactus.java b/mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileCactus.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileCactus.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileCactus.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileEnchantmentTable.java b/mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileEnchantmentTable.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileEnchantmentTable.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileEnchantmentTable.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileFlower.java b/mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileFlower.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileFlower.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileFlower.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileGrass.java b/mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileGrass.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileGrass.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileGrass.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileWheat.java b/mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileWheat.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileWheat.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tiles/TileWheat.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolBucket.java b/mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolBucket.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolBucket.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolBucket.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEraser.java b/mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolEraser.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEraser.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolEraser.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEyeDropper.java b/mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolEyeDropper.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEyeDropper.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolEyeDropper.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolPencil.java b/mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolPencil.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolPencil.java rename to mineos/src/main/java/dev/ultreon/mineos/object/tools/ToolPencil.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/Font.java b/mineos/src/main/java/dev/ultreon/mineos/userspace/Font.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/userspace/Font.java rename to mineos/src/main/java/dev/ultreon/mineos/userspace/Font.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/GuiGraphics.java b/mineos/src/main/java/dev/ultreon/mineos/userspace/GuiGraphics.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/userspace/GuiGraphics.java rename to mineos/src/main/java/dev/ultreon/mineos/userspace/GuiGraphics.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/MineOS.java b/mineos/src/main/java/dev/ultreon/mineos/userspace/MineOS.java similarity index 99% rename from common/src/mineos/java/dev/ultreon/mineos/userspace/MineOS.java rename to mineos/src/main/java/dev/ultreon/mineos/userspace/MineOS.java index b6e37c68..28036d2c 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/userspace/MineOS.java +++ b/mineos/src/main/java/dev/ultreon/mineos/userspace/MineOS.java @@ -1,6 +1,5 @@ package dev.ultreon.mineos.userspace; -import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.datafixers.util.Pair; @@ -200,6 +199,7 @@ public class MineOS implements MineOSSystem { KK_BACKTICK = 96; private static MineOS instance = null; private static Font font; + private static FileSystem fileSystem; private final MineOSKernel kernel = new MineOSKernel(); @@ -267,6 +267,10 @@ public static MineOS get() { return instance; } + public static FileSystem files() { + return fileSystem; + } + public int getScreenWidth() { return videoInfo.width(); } diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/Settings.java b/mineos/src/main/java/dev/ultreon/mineos/userspace/Settings.java similarity index 82% rename from common/src/mineos/java/dev/ultreon/mineos/userspace/Settings.java rename to mineos/src/main/java/dev/ultreon/mineos/userspace/Settings.java index 8901e3fa..61a4e654 100644 --- a/common/src/mineos/java/dev/ultreon/mineos/userspace/Settings.java +++ b/mineos/src/main/java/dev/ultreon/mineos/userspace/Settings.java @@ -3,8 +3,6 @@ import dev.ultreon.mineos.object.AppInfo; import dev.ultreon.mineos.apps.system.object.ColorScheme; import dev.ultreon.mineos.apps.system.object.Preset; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.Tag; /** * @author MrCrayfish @@ -39,13 +37,8 @@ public void setPreset(Preset preset) { this.preset = preset; } - public CompoundTag toTag() { - CompoundTag tag = new CompoundTag(); - tag.putBoolean("showAllApps", showAllApps); - tag.put("colorScheme", colorScheme.toTag()); - if (preset != null) - tag.put("preset", preset.toTag()); - tag.put("tints", appTintInfo()); + public CompoundTag save() { + MineOS.files().save("settings", this.toTag()); return tag; } diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/TaskBar.java b/mineos/src/main/java/dev/ultreon/mineos/userspace/TaskBar.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/userspace/TaskBar.java rename to mineos/src/main/java/dev/ultreon/mineos/userspace/TaskBar.java diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/Window.java b/mineos/src/main/java/dev/ultreon/mineos/userspace/Window.java similarity index 100% rename from common/src/mineos/java/dev/ultreon/mineos/userspace/Window.java rename to mineos/src/main/java/dev/ultreon/mineos/userspace/Window.java diff --git a/settings.gradle b/settings.gradle index 0af978f3..78d9f412 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,4 +14,22 @@ include("neoforge") include("fabric-datagen-helper") include("fabric-testmod") include 'api' +include 'bios' +include 'mineos' +include 'mineos:installer' +findProject(':mineos:installer')?.name = 'installer' +include 'mineos:kernel' +findProject(':mineos:kernel')?.name = 'kernel' +include 'mineos:bootloader' +findProject(':mineos:bootloader')?.name = 'bootloader' +include 'mineos:kernel:api' +findProject(':mineos:kernel:api')?.name = 'api' +include 'mineos:kernel:impl' +findProject(':mineos:kernel:impl')?.name = 'impl' +include 'mineos:desktop' +findProject(':mineos:desktop')?.name = 'desktop' +include 'mineos:desktop:logon' +findProject(':mineos:desktop:logon')?.name = 'logon' +include 'mineos:desktop:registry-lib' +findProject(':mineos:desktop:registry-lib')?.name = 'registry-lib'