- Saved searches
- Use saved searches to filter your results more quickly
- License
- niklasstich/selfmade-os
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Пишем ОС… на Java?
- Is it possible to make an operating system using java?
- Is it possible to make an operating system using java?
- Java Swing GUIs on Mac OS X
- Java GUI Automatically Resizing
- Do Java GUIs display the same on all operating systems?
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
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:
- 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. You’ll have to use Apple’s Cocoa-Java bridge, which is no longer supported. I have no idea how tractable JNI is on OS X, which is the only real alternative.
Performance shouldn’t be a problem. Drag & Drop is probably as hairy on OS X as it is everywhere else.
Basically, if you’re explicitly targeting OS X you’re best off using Objective-C. Its far from impossible to build an app on OS X using Java & Swing, but its a lot of work to make it look «native».
As Kevin and John said you should try Objective-C, Cocoa and XCode if you are only targeting Mac users. The developer tools for Mac is freely available.
If you want to (or have to) use Java and Swing you can use some libraries to create a GUI that looks well on Macs:
For deploying your application you should read the JarBundler docs.
However, in this case interaction with dock and native applications is very limited.
Some other good links are:
- Making Java/Swing Applications Look (More) Like Native Mac OS X Applications
- Java: How to handle drop events to the Mac OS X Dock icon
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. Swing is a decent choice. It’s better but like in any toolkit there are still issues. You’ll never get a truly native look and feel with it, same goes for similar UI toolkits which claim to be «cross-platform».
The Apple Guidelines for Java development can be found here.
How to make a gui from code in java Code Example, import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import
Java GUI Automatically Resizing
Use a layout manager instead of setting the bounds for each component.
It is going to vary from program to program how you want your components to move.
Take a look at this, and try to see which layout will work best for you.
1. You can use setSize() method to set your JFrame size .
2. You can choose to make the size of JFrame fixed by setting isResizable(false) .
3. Use GroupLayout, developed by NetBeans team in 2005 , try using the Windows Builder Pro provided by Google now for free. Here you can select GroupLayout, and then drag and drop your components in the JFrame, even if you want you can manually edit the GUI code.
How to gui on java Code Example, import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import
Do Java GUIs display the same on all operating systems?
Used correctly, common Swing components are pleasantly stable across platforms and L&Fs, but there are no guarantees. One should avoid the temptation to violate UI defaults gratuitously. Example of this abound, but common pitfalls regarding size are discussed here and here. Testing is mandatory, but widely available virtual machines mitigate the effort.
Pretty much so. But using the UIManager you can determine a theme based on an operating system’s theme.
Example:UIManager.LookAndFeelInfo looks[] = UIManager.getInstalledLookAndFeels(); try< //0-Swing, 1-Mac, 2-?, 3-Windows, 4-Old Windows UIManager.setLookAndFeel(looks[3].getClassName()); >catch(Exception e)
yes they will as long as you use swing and no platform specific code.
That said: They will not feel ‘natural’ then. SWT is a tad better there
Swing — Java GUI Automatically Resizing, You can use setSize () method to set your JFrame size. 2. You can choose to make the size of JFrame fixed by setting isResizable (false). 3. Use GroupLayout, developed by NetBeans team in 2005, try using the Windows Builder Pro provided by Google now for free.