Making an operating system in java

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A custom, barebones operating system written in a dialect of Java6

License

niklasstich/selfmade-os

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Betriebssystem im Eigenbau — Self-made operating system

Meine Kursteilnahme am Masterkurs «Betriebssystem im Eigenbau» der Hochschule Kempten

My course participation on the masters course «self-made operating system» at University of Applied Sciences Kempten

Preview

This repository contains a basic operating system written in a dialect of Java as defined by the SJC compiler. It currently handles memory management with garbage collection, can list attatched PCI devices, has some basic terminal functionality

Requires a full and functioning QEMU installation. See Makefile for configuration.

Simply run make install-toolchain to install the SJC compiler and make run to compile and run the operating system in a QEMU virtual machine.

The code in this repository is released under the GNU Public License Version 3, of which you can find a copy here.

The SJC compiler is released under the GNU Public License Version 3. All copyright remains with Stefan Frenz and Patrick Schmidt.

About

A custom, barebones operating system written in a dialect of Java6

Источник

Пишем ОС… на Java?

Недавно мне в руки попала интересная вещь — Simple Java Compiler от Стефана Френца. Как он сам пишет, его компилятор преобразует Java-код в native-код для определенной архитектуры (поддержка IA-32 и AMD64). Компилятор использует спец-аннотации. Автор реализовал с помощью компилятора несколько ОС. Также один умелец по имени lenidh написал ОС Bearded Robot.

Компилятор можно скачать на сайте автора.

Сегодня я вам покажу, как написать нативный «Hello, world!», который потом можно запустить в QEMU.

Класс Object — суперкласс всех классов в Java.

package java.lang; import rte.SClassDesc; public class Object < public final SClassDesc _r_type=null; public final Object _r_next=null; public final int _r_relocEntries=0, _r_scalarSize=0; >package java.lang; public class String < private char[] value; private int count; @SJC.Inline public int length() < return count; >@SJC.Inline public char charAt(int i) < return value[i]; >> package rte; public class SArray < public final int length=0, _r_dim=0, _r_stdType=0; public final Object _r_unitType=null; >package rte; public class SClassDesc < public SClassDesc parent; public SIntfMap implementations; >package rte; public class SIntfDesc < >package rte; public class SIntfMap < public SIntfDesc owner; public SIntfMap next; >package rte; public class SMthdBlock < >package rte; public class DynamicRuntime < public static Object newInstance(int scalarSize, int relocEntries, SClassDesc type) < while(true); >public static SArray newArray(int length, int arrDim, int entrySize, int stdType, Object unitType) < while(true); >public static void newMultArray(SArray[] parent, int curLevel, int destLevel, int length, int arrDim, int entrySize, int stdType, Object unitType) < while(true); >public static boolean isInstance(Object o, SClassDesc dest, boolean asCast) < while(true); >public static SIntfMap isImplementation(Object o, SIntfDesc dest, boolean asCast) < while(true); >public static boolean isArray(SArray o, int stdType, Object unitType, int arrDim, boolean asCast) < while(true); >public static void checkArrayStore(Object dest, SArray newEntry) < while(true); >> 
package kernel; public class Kernel < private static int vidMem=0xB8000; public static void main() < print("Hello World"); while(true); >public static void print(String str) < int i; for (i=0; ipublic static void print(char c) < MAGIC.wMem8(vidMem++, (byte)c); MAGIC.wMem8(vidMem++, (byte)0x07); >> 
./compile rte.java hello.java -o boot 

Пример для 64-bit есть в поставке компилятора.

compile rte.java hello.java -o boot 

Пример для AMD64 есть в поставке компилятора.

qemu-system-i386 -boot a -fda BOOT_FLP.IMG 

Источник

Is it possible to make an operating system using java?

The minimum required to even hope to pass as a Mac app: package your .jar in a .app set the L&F to system default set apple.laf.useScreenMenuBar property to true must do this before any UI code Dock interaction is non-existent in standard Java. Like Native Mac OS X Applications Java: How to handle drop events to the Mac OS X Dock icon Solution 3: @Kevin++ Using Cocoa is probably better If you want it to look exactly like native applications If you are targeting only the Mac If you intend to distribute your applications for Windows, Linux, etc.

Is it possible to make an operating system using java?

In theory yes, but you’ll still have to have some low-level assembly code to bootstrap the Java VM that will run on the machine, and also low-level code for accessing hardware drivers.

Given that Sun Microsystems’ Java is today one of the most dominant object-oriented languages, it is no surprise that Java-based operating systems have been attempted. In this area, ideally, the kernel would consist of the bare minimum required to support a JVM. This is the only component of such an operating system that would have to be written in a language other than Java. Built upon that JVM and basic hardware support, it would be possible to write the rest of the operating system in Java; even parts of the system that are more traditionally written in a lower-level language such as C, for example device drivers, can be written in Java.

Examples of attempts at such an operating system include JX, JNode and JavaOS.

In theory, yes. But you would need to somehow get the Java VM running using low-level code (unless you want to compile Java down to assembly, which probably isn’t possible without sacrificing a lot of Java’s features).

Java how to make a gui Code Example, “java how to make a gui” Code Answer. java how to make a gui . java by Dark Dugong on Mar 07 2020 Comment Dark Dugong on Mar 07 2020 Comment

Java Swing GUIs on Mac OS X

Swing isn’t going to give you perfect fidelity with the hosting OS. Sun simply can’t devote the considerable resources necessary to do so. My impression is that Swing has gotten much better, but is still going to look out of place by default.

The minimum required to even hope to pass as a Mac app:

Оцените статью