[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:11.79,0:00:15.71,Default,,0000,0000,0000,,Saturday the 19th September 2015 Dialogue: 0,0:00:25.93,0:00:36.10,Default,,0000,0000,0000,,Hi my name is Joakim Nordström, and I'm going to talk about \NJava for Amiga, which is my night time project. Dialogue: 0,0:00:38.13,0:00:41.69,Default,,0000,0000,0000,,At daytime I'm a system developer at Telia here in Uppsala Dialogue: 0,0:00:42.24,0:00:49.45,Default,,0000,0000,0000,,and at night time I'm trying to get java to work on the Amiga Dialogue: 0,0:00:52.94,0:01:03.59,Default,,0000,0000,0000,,The project I'm working is called JAmiga, and I have continued on\Nan open source project from 2003-2005 Dialogue: 0,0:01:04.14,0:01:10.82,Default,,0000,0000,0000,,It was started by two Germans, Peter Werno and Andre Dörffler. Dialogue: 0,0:01:12.60,0:01:16.75,Default,,0000,0000,0000,,They started creating Java for Amiga. Dialogue: 0,0:01:16.75,0:01:23.09,Default,,0000,0000,0000,,and released a version in 2005, and then nothing much happened\Nuntil around 2009 when I began looking at it. Dialogue: 0,0:01:25.08,0:01:30.57,Default,,0000,0000,0000,,At that time they supported parts of Java 1.4. Dialogue: 0,0:01:32.46,0:01:38.02,Default,,0000,0000,0000,,If you know something about Java, you'll get something from this,\Nand if you know nothing about Java, I hope you'll also get something out of this. Dialogue: 0,0:01:39.06,0:01:44.100,Default,,0000,0000,0000,,So hopefully everyone will be happy at the end, \Nor everyone will be confused by my ramblings. Dialogue: 0,0:01:45.82,0:01:52.28,Default,,0000,0000,0000,,The target architecture is Amiga, and I'm working at the next generation Amiga. Dialogue: 0,0:01:53.22,0:02:00.92,Default,,0000,0000,0000,,So it isn't the classic Amiga as seen on the first slide I'm focusing, but rather the next generation Amigas. Dialogue: 0,0:02:01.38,0:02:13.59,Default,,0000,0000,0000,,And, believe it or not, Amiga still selling some sort of computers, and then one I have is this with a Power PC processor. Dialogue: 0,0:02:13.59,0:02:23.04,Default,,0000,0000,0000,,And if I'm not mistaken, this is the same processor Mac should've used, if they didn't switch to Intel. Dialogue: 0,0:02:25.66,0:02:35.38,Default,,0000,0000,0000,,The operating system i s Amiga OS 4.1, the latest release. Dialogue: 0,0:02:35.85,0:02:41.50,Default,,0000,0000,0000,,Audience question: can you run old Amiga applications on this new computer? Dialogue: 0,0:02:41.50,0:02:53.66,Default,,0000,0000,0000,,Yes, yes you can, AmigaOS emulates the old Amigas, and can also take advantage of the updated functionality. Dialogue: 0,0:02:55.17,0:03:02.36,Default,,0000,0000,0000,,Audience question: as an old Amiga user, have they fixed the biggest problem, that the entire file system was corrupted when the machine crashed? Dialogue: 0,0:03:02.38,0:03:09.90,Default,,0000,0000,0000,,Yes, there are a few new file systems that aren't as sensitive. Dialogue: 0,0:03:09.90,0:03:12.61,Default,,0000,0000,0000,,Audience question: Have they removed the Guru meditation? Dialogue: 0,0:03:12.66,0:03:18.67,Default,,0000,0000,0000,,Yes, I'm sorry, they've replaced it with the Grim Reaper. Dialogue: 0,0:03:23.77,0:03:28.74,Default,,0000,0000,0000,,So the guru is gone, but problems persist. Dialogue: 0,0:03:30.62,0:03:39.98,Default,,0000,0000,0000,,I'm going to start by showing the parts in a typical Java\Ninstallation, so we'll get a common ground to start from. Dialogue: 0,0:03:41.34,0:03:48.50,Default,,0000,0000,0000,,In essence, it's these four parts. And I'm going to go through them one by one. Dialogue: 0,0:03:50.57,0:03:54.86,Default,,0000,0000,0000,,We'll start with the JVM. Dialogue: 0,0:03:56.22,0:04:02.33,Default,,0000,0000,0000,,The java Virtual Machine is an executable file, usually java.exe. Dialogue: 0,0:04:02.33,0:04:18.87,Default,,0000,0000,0000,,It execute bytecode, and bytecode is the JVM's internal instructions, \Njust like an x86 processor has x86 instructions, and PPC has PPC instructions. Dialogue: 0,0:04:18.87,0:04:24.37,Default,,0000,0000,0000,,The JVM translates from bytecode to processor instructions. Dialogue: 0,0:04:24.37,0:04:33.31,Default,,0000,0000,0000,,In the most simple case, it's relatively easy. \NOne instructions have its obvious counterpart. Dialogue: 0,0:04:33.31,0:04:37.42,Default,,0000,0000,0000,,Sometimes one bytecode is several processor instructions, and so on. Dialogue: 0,0:04:37.45,0:04:41.39,Default,,0000,0000,0000,,It is however a rather slow process, if you take the easy way. Dialogue: 0,0:04:41.39,0:04:47.48,Default,,0000,0000,0000,,If you want more a advanced JVM, you have to do various smart things. Dialogue: 0,0:04:51.58,0:04:56.99,Default,,0000,0000,0000,,The JVM also handles memory and that stuff. Dialogue: 0,0:05:00.17,0:05:04.58,Default,,0000,0000,0000,,Going right we come to the class library. Dialogue: 0,0:05:05.59,0:05:10.71,Default,,0000,0000,0000,,And this is basically the Java SE standard. Dialogue: 0,0:05:10.71,0:05:16.32,Default,,0000,0000,0000,,The class library are the standard classes you use when youäre developiong Java programs. Dialogue: 0,0:05:16.32,0:05:21.58,Default,,0000,0000,0000,,And it's basically Oracle that decides how this should look. Dialogue: 0,0:05:22.83,0:05:30.100,Default,,0000,0000,0000,,And if you know your Java, you recognize all the standard classes, in the java packages. Dialogue: 0,0:05:31.41,0:05:40.69,Default,,0000,0000,0000,,This is stuff like handling lists, writing to the console, \Nopen files, and, handling XML and various things. Dialogue: 0,0:05:44.80,0:05:51.13,Default,,0000,0000,0000,,In order to for instance open a file, we need to somehow get \Naccess to the underlying operating system. Dialogue: 0,0:05:51.69,0:05:55.32,Default,,0000,0000,0000,,For this we have the native library. Dialogue: 0,0:05:56.60,0:06:04.40,Default,,0000,0000,0000,,And this is the way from the class library, which is the same for all JVM's, Dialogue: 0,0:06:04.40,0:06:11.22,Default,,0000,0000,0000,,but the native library is different, depending on the operating system. Dialogue: 0,0:06:11.22,0:06:19.74,Default,,0000,0000,0000,,When we're on Windows, the native library is a DLL, Unix/Linux uses shared objects, and on AmigaOS its library files. Dialogue: 0,0:06:22.69,0:06:27.18,Default,,0000,0000,0000,,And this is basically the parts we have in a JVM. Dialogue: 0,0:06:28.60,0:06:34.78,Default,,0000,0000,0000,,And now I'm going to show what alternatives we have for these parts. Dialogue: 0,0:06:35.30,0:06:41.84,Default,,0000,0000,0000,,The class library and the native library are closely tied together. Dialogue: 0,0:06:42.13,0:06:57.96,Default,,0000,0000,0000,,And there is in essence two choices: OpenJDK from Oracle, and GNU Classpath. Dialogue: 0,0:06:58.04,0:07:04.52,Default,,0000,0000,0000,,Open JDK supports the later Java versions 7, 8 and 9. Dialogue: 0,0:07:06.42,0:07:11.26,Default,,0000,0000,0000,,In the beginning OpenJDK wasn't "Open" Dialogue: 0,0:07:13.94,0:07:31.57,Default,,0000,0000,0000,,Somewhere between Java 6 and 7 that Sun decided to open up JDK and make it open source. Dialogue: 0,0:07:32.75,0:07:37.98,Default,,0000,0000,0000,,Before that, around 1998 the JDK was still closed source. Dialogue: 0,0:07:37.98,0:07:46.43,Default,,0000,0000,0000,,And then some people started GNU Classpath, which is an open source version of the Java standard. Dialogue: 0,0:07:46.43,0:07:53.45,Default,,0000,0000,0000,,They implemented everything in the Java standard from scratch. Dialogue: 0,0:07:53.45,0:08:01.32,Default,,0000,0000,0000,,And when OpenJDK became Open, people stopped developing for GNU Classpath. Dialogue: 0,0:08:01.35,0:08:06.13,Default,,0000,0000,0000,,A lot of people who started with GNU Classpath, are now developing for OpenJDK. Dialogue: 0,0:08:06.13,0:08:09.73,Default,,0000,0000,0000,,Some work at Oracle, and some develop in their spare time. Dialogue: 0,0:08:16.91,0:08:18.61,Default,,0000,0000,0000,,A few different JVM options Dialogue: 0,0:08:19.39,0:08:25.91,Default,,0000,0000,0000,,What you're probably using today is Oracle's hotspot, Dialogue: 0,0:08:25.91,0:08:31.96,Default,,0000,0000,0000,,which is, if I'm not mistaken, a combination of JRockit and HotSpot. Dialogue: 0,0:08:31.96,0:08:39.93,Default,,0000,0000,0000,,JRockit is actually a JVM developed by a Swedish company, later bought by Oracle. Dialogue: 0,0:08:39.93,0:08:47.67,Default,,0000,0000,0000,,Some of the JRockit developers are like working a t Oracle now. Dialogue: 0,0:08:49.06,0:08:53.91,Default,,0000,0000,0000,,Microsoft and MacOS had their own JVMs up until 2001. Dialogue: 0,0:08:53.91,0:09:00.56,Default,,0000,0000,0000,,Or rather, Windows had its to 2001, and Mac had its until OSX. Dialogue: 0,0:09:01.43,0:09:04.57,Default,,0000,0000,0000,,But then they skipped them, and let people decide themselver Dialogue: 0,0:09:04.90,0:09:08.58,Default,,0000,0000,0000,,Then we have onw called "Kaffe". Dialogue: 0,0:09:08.83,0:09:13.86,Default,,0000,0000,0000,,Its open source, and it support GNU Classpath Dialogue: 0,0:09:13.86,0:09:19.32,Default,,0000,0000,0000,,It also exists for Classic Amigas, i.e. the 68k processor. Dialogue: 0,0:09:19.32,0:09:30.97,Default,,0000,0000,0000,,The Jamiga project also has it s own virtual machine, which also can run on Classic Amigas. Dialogue: 0,0:09:31.33,0:09:37.08,Default,,0000,0000,0000,,Then there's a nother variant, GCJ, GNU Compiler for Java. Dialogue: 0,0:09:37.08,0:09:45.20,Default,,0000,0000,0000,,Which compiles either java code, or bytecode, to machine dependent code. Dialogue: 0,0:09:45.20,0:09:50.94,Default,,0000,0000,0000,,So the bytecode is translated to x86 or PPC code. Dialogue: 0,0:09:50.94,0:10:00.39,Default,,0000,0000,0000,,So you get a binary which needs to be compiled for each new architecture. Dialogue: 0,0:10:00.39,0:10:05.66,Default,,0000,0000,0000,,Then I can also mention Dalvik which is Android's VM. Dialogue: 0,0:10:05.66,0:10:14.35,Default,,0000,0000,0000,,And there's a small dispute, if Dalvik isn't in fact JamVM, where \NGoogle took the JamVM code and called it Dalvik. Dialogue: 0,0:10:15.20,0:10:20.77,Default,,0000,0000,0000,,But, lets focus on this VM JamVM. Dialogue: 0,0:10:21.53,0:10:29.90,Default,,0000,0000,0000,,It's developed since 2003, written in C, with some assembler. Dialogue: 0,0:10:29.90,0:10:34.20,Default,,0000,0000,0000,,It uses Posix threads, and it supports PowerPC. Dialogue: 0,0:10:34.22,0:10:38.96,Default,,0000,0000,0000,,So I thought this was good and interesting. Dialogue: 0,0:10:39.65,0:10:43.88,Default,,0000,0000,0000,,So instead of continuing JAmiga's VM, I began looking at using JamVM. Dialogue: 0,0:10:44.34,0:10:46.44,Default,,0000,0000,0000,,And that is what I've done. Dialogue: 0,0:10:47.36,0:10:54.88,Default,,0000,0000,0000,,In teh beginning it only supported GNU Classpath, but then when OpenJDK became open, it supports that aswell. Dialogue: 0,0:10:55.42,0:11:02.16,Default,,0000,0000,0000,,So when I'm developing, I'm porting JamVM. Dialogue: 0,0:11:04.07,0:11:10.12,Default,,0000,0000,0000,,A small summary. \NThe JVM is JamVM Dialogue: 0,0:11:10.55,0:11:18.60,Default,,0000,0000,0000,,The class library is GNU Classpath, since that is what original JAmiga supported. Dialogue: 0,0:11:19.15,0:11:21.08,Default,,0000,0000,0000,,So I've continnued with that. Dialogue: 0,0:11:21.35,0:11:25.68,Default,,0000,0000,0000,,Native libraries are .library, and operating system AmigaOS 4.1. Dialogue: 0,0:11:31.92,0:11:40.49,Default,,0000,0000,0000,,I can talk a bit about the interface of GNU Classpath. Dialogue: 0,0:11:41.12,0:11:45.70,Default,,0000,0000,0000,,From the class library, via the native library down to the operating system. Dialogue: 0,0:11:45.70,0:11:50.02,Default,,0000,0000,0000,,And there's a number of different native libraries. Dialogue: 0,0:11:50.02,0:11:53.54,Default,,0000,0000,0000,,And these libraries corresponds to the Java packages. Dialogue: 0,0:11:53.54,0:12:02.70,Default,,0000,0000,0000,,Comparing this with OpenJDk, they have one big library for all classes Dialogue: 0,0:12:02.70,0:12:11.64,Default,,0000,0000,0000,,A small screen shot over GNU Classpath file structure. Dialogue: 0,0:12:11.64,0:12:17.73,Default,,0000,0000,0000,,On the right side we see the Java standard class "java.lang.System". Dialogue: 0,0:12:17.73,0:12:21.51,Default,,0000,0000,0000,,This has some connectiosn down to the operating system. Dialogue: 0,0:12:21.51,0:12:25.29,Default,,0000,0000,0000,,And those connectiosn can be found in the "java.lang.VMSystm" class. Dialogue: 0,0:12:25.29,0:12:28.34,Default,,0000,0000,0000,,And that is a pretty nice connection. Dialogue: 0,0:12:28.34,0:12:38.85,Default,,0000,0000,0000,,If we have a Java class, wee know which native class we should look in,\Nto find connections to the OS. Dialogue: 0,0:12:38.85,0:12:47.02,Default,,0000,0000,0000,,In OpenJDK it isn't quite as nice, but I think they're trying to achieve that. Dialogue: 0,0:12:48.20,0:12:53.12,Default,,0000,0000,0000,,And now we're going to run some Amiga. Dialogue: 0,0:12:53.12,0:12:59.80,Default,,0000,0000,0000,,I'm going to show how it looks when you run a Java program, and what happens in the Java code. Dialogue: 0,0:12:59.80,0:13:03.31,Default,,0000,0000,0000,,So, now there's going to be some code. Dialogue: 0,0:13:03.31,0:13:06.96,Default,,0000,0000,0000,,Here we have a small Java program. Dialogue: 0,0:13:06.96,0:13:12.67,Default,,0000,0000,0000,,And here we have a main method that will print to the console "Hello Uppsala". Dialogue: 0,0:13:12.67,0:13:16.39,Default,,0000,0000,0000,,I.e. "Hello World" in Java. Dialogue: 0,0:13:16.39,0:13:22.49,Default,,0000,0000,0000,,And we're going to see what happens "under the hood". Dialogue: 0,0:13:22.49,0:13:24.84,Default,,0000,0000,0000,,Audience question: is your laptop an Amiga machine? Dialogue: 0,0:13:24.84,0:13:25.77,Default,,0000,0000,0000,,No. Dialogue: 0,0:13:25.77,0:13:28.01,Default,,0000,0000,0000,,No. Its an Ubuntu. Dialogue: 0,0:13:28.01,0:13:30.59,Default,,0000,0000,0000,,The amiga is at home, it's to big to take with me. Dialogue: 0,0:13:30.59,0:13:36.47,Default,,0000,0000,0000,,So this is just pictures. Dialogue: 0,0:13:36.88,0:13:43.82,Default,,0000,0000,0000,,We begin here in "Java.lang.System"\N"System" is a class in the java standard. Dialogue: 0,0:13:43.82,0:13:47.26,Default,,0000,0000,0000,,And then we have an object "out" here. Dialogue: 0,0:13:47.26,0:13:53.76,Default,,0000,0000,0000,,And if we go to the System class, we'll find that "out" is a PrintStream. Dialogue: 0,0:13:53.76,0:14:01.48,Default,,0000,0000,0000,,And if you know your Java, you know that PrintStream has a method "printline",\Nwhich print a line to the stream. Dialogue: 0,0:14:01.48,0:14:09.46,Default,,0000,0000,0000,,Then we need to look at what "out" is initialised to. Dialogue: 0,0:14:09.46,0:14:15.08,Default,,0000,0000,0000,,And then we see this VMSystem class, which has a method "makeStadnardOutputStream". Dialogue: 0,0:14:15.08,0:14:20.10,Default,,0000,0000,0000,,So we move along to that class. Dialogue: 0,0:14:20.10,0:14:29.84,Default,,0000,0000,0000,,And now, this is VMSystem. I.e not a Java standard class, but a aprt of Gnu CLasspath.. Dialogue: 0,0:14:29.84,0:14:34.42,Default,,0000,0000,0000,,And here we have a method "makeStandradOutputStream" Dialogue: 0,0:14:34.42,0:14:40.04,Default,,0000,0000,0000,,This returns a PrintStream, which wraps around a BufferedOutputStream\Nthat wraps around a FileOutputStream... Dialogue: 0,0:14:40.04,0:14:45.48,Default,,0000,0000,0000,,If you know your Java, you know about these streams... \Nbut we'll ignore that for now. Dialogue: 0,0:14:45.48,0:14:50.16,Default,,0000,0000,0000,,The main thing here is the "FileDescriptor.out". Dialogue: 0,0:14:50.16,0:14:53.77,Default,,0000,0000,0000,,This is just ordinary Java code. Dialogue: 0,0:14:53.77,0:14:56.72,Default,,0000,0000,0000,,But this "FileDescriptor.out" is a bit interesting. Dialogue: 0,0:14:56.72,0:15:01.60,Default,,0000,0000,0000,,So we move on that.\NWe end up in a new class: "FileDescriptor" Dialogue: 0,0:15:01.60,0:15:05.40,Default,,0000,0000,0000,,And that has an object named "out" up there. Dialogue: 0,0:15:05.40,0:15:14.97,Default,,0000,0000,0000,,And.. that is a FileDescriptor object, which has an \Nparameter FileChannelImpl.out, again. Dialogue: 0,0:15:14.97,0:15:18.83,Default,,0000,0000,0000,,So we move on to the class "FileChannelImpl". Dialogue: 0,0:15:18.83,0:15:25.70,Default,,0000,0000,0000,,And there we find the object "out", somewhere... \NThere! Dialogue: 0,0:15:26.98,0:15:31.72,Default,,0000,0000,0000,,And if we look here; here we load our library "javanio". Dialogue: 0,0:15:31.82,0:15:41.32,Default,,0000,0000,0000,,So when this line is executed we're going to open "javanio.library".\NIf this was Windows, we would've opened "javanio.dll". Dialogue: 0,0:15:43.86,0:15:46.14,Default,,0000,0000,0000,,We continue with "out". Dialogue: 0,0:15:47.26,0:15:53.51,Default,,0000,0000,0000,,Down here we see "out=ch". \NAnd "ch" we previously set to a FileChannelImpl. Dialogue: 0,0:15:53.51,0:15:59.36,Default,,0000,0000,0000,,Which is wrapped around a "VMFileChannelImpl.getStandardOut()". Dialogue: 0,0:15:59.36,0:16:05.66,Default,,0000,0000,0000,,So we move along to the "VMFileChannelImpl" class Dialogue: 0,0:16:05.66,0:16:10.39,Default,,0000,0000,0000,,And then we see the method "getStandardOut()" Dialogue: 0,0:16:10.39,0:16:16.58,Default,,0000,0000,0000,,And that methd is here "getStandardOut",\Nwhich return a new VMFileChannel Dialogue: 0,0:16:16.58,0:16:25.85,Default,,0000,0000,0000,,And calls a method "stdout_fd",\Nwhich is here, and it has no method body... Dialogue: 0,0:16:25.85,0:16:31.84,Default,,0000,0000,0000,,However, it has a intereseting word here: "native" Dialogue: 0,0:16:31.84,0:16:37.55,Default,,0000,0000,0000,,This means, that this call will be made to some sort of native library. Dialogue: 0,0:16:37.55,0:16:42.18,Default,,0000,0000,0000,,And now we will go from Java to C. Dialogue: 0,0:16:42.18,0:16:47.59,Default,,0000,0000,0000,,So this is C code. Dialogue: 0,0:16:47.59,0:16:53.71,Default,,0000,0000,0000,,And this is the function that is executed when we call this native method. Dialogue: 0,0:16:54.79,0:17:01.11,Default,,0000,0000,0000,,And, now,m if you know your Amiga,\Nyou might recognize this "IDOS->Output()". Dialogue: 0,0:17:01.11,0:17:07.87,Default,,0000,0000,0000,,This is a C function in Amigas SDk, which returns a pointer to the console. Dialogue: 0,0:17:08.42,0:17:15.73,Default,,0000,0000,0000,,So the pointer to the console is returned into the Java code,\Nand going all the way back... Dialogue: 0,0:17:16.17,0:17:29.67,Default,,0000,0000,0000,,So, somewhere here in the System.out, there is a small pointer to our C function. Dialogue: 0,0:17:33.21,0:17:38.49,Default,,0000,0000,0000,,So this is some explanation to why Java is a bit slow to start up. Dialogue: 0,0:17:39.52,0:17:50.54,Default,,0000,0000,0000,,Aroudn 1995-1996 it took a long time to start a JVM,\Nsince all these classes had to be loaded on start-up Dialogue: 0,0:17:52.42,0:17:58.35,Default,,0000,0000,0000,,It is also a bit hard to find errors, when you don't know where you are. Dialogue: 0,0:17:58.86,0:18:05.04,Default,,0000,0000,0000,,This call.... er... eh Dialogue: 0,0:18:05.65,0:18:13.54,Default,,0000,0000,0000,,This call, from Java code to C code,\Nlooks a bit magic. Dialogue: 0,0:18:13.54,0:18:19.25,Default,,0000,0000,0000,,And it is a bit magic, \Nbut not much. Dialogue: 0,0:18:19.28,0:18:29.81,Default,,0000,0000,0000,,How does the JVM know which native method it should find? Dialogue: 0,0:18:30.49,0:18:39.30,Default,,0000,0000,0000,,From out antive libaray we can export different functions. Dialogue: 0,0:18:39.30,0:18:51.67,Default,,0000,0000,0000,,In the Java standard, it is defined that all native \Nfunctions will have a standard name, Dialogue: 0,0:18:52.23,0:19:00.37,Default,,0000,0000,0000,,with a prefix, followed by the java package, method name and arguments,\Nso the VM can find the method. Dialogue: 0,0:19:02.58,0:19:13.56,Default,,0000,0000,0000,,And with these small header definitions in the C code,\Nthe compile knows that these functions should be exported Dialogue: 0,0:19:15.14,0:19:18.75,Default,,0000,0000,0000,,But this is not how it works on the Amiga. Dialogue: 0,0:19:18.75,0:19:26.70,Default,,0000,0000,0000,,In the Amigas native libraries we only export on function "getLibraryContent" Dialogue: 0,0:19:26.70,0:19:33.98,Default,,0000,0000,0000,,And that returns a strcture where the JVM can do the lookup. Dialogue: 0,0:19:34.56,0:19:44.15,Default,,0000,0000,0000,,So that is one difference in Amiga. Dialogue: 0,0:19:46.13,0:19:49.44,Default,,0000,0000,0000,,Then ,some more code.\NA different example. Dialogue: 0,0:19:49.80,0:19:54.50,Default,,0000,0000,0000,,We're going to look at the class VMSecureRandom.java Dialogue: 0,0:19:55.78,0:20:00.21,Default,,0000,0000,0000,,The VM prefix tells us that there might be antive calls in here. Dialogue: 0,0:20:00.83,0:20:11.71,Default,,0000,0000,0000,,And this class generates a random seed,\Nwhich is used by f.i. cryptography. Dialogue: 0,0:20:13.58,0:20:21.78,Default,,0000,0000,0000,,And one of my users that tested Jamiga,\Nfound a small crypto library Dialogue: 0,0:20:21.78,0:20:22.30,Default,,0000,0000,0000,,However, when executing it, the entire machine locked up. Dialogue: 0,0:20:28.26,0:20:35.69,Default,,0000,0000,0000,,And this is the VMSecureRandom class.\NThe detalis aren't important. Dialogue: 0,0:20:35.69,0:20:40.65,Default,,0000,0000,0000,,But here we have the method "generateSeed",\Nthat generates our seed. Dialogue: 0,0:20:40.65,0:20:44.31,Default,,0000,0000,0000,,It does this by starting 8 threads that spins,\Nand increments a counter, Dialogue: 0,0:20:44.31,0:20:50.28,Default,,0000,0000,0000,,and then randomly they will end,\Nand then we'll end up with a random value. Dialogue: 0,0:20:50.83,0:21:01.11,Default,,0000,0000,0000,,And it was here that JVM started 8 threads, got into a (unsolved) race condition. Dialogue: 0,0:21:01.11,0:21:06.95,Default,,0000,0000,0000,,however, I managed to shorten this method to this. Dialogue: 0,0:21:06.95,0:21:12.29,Default,,0000,0000,0000,,Here we instead open a file from the Amiga device "Random:" Dialogue: 0,0:21:12.29,0:21:20.27,Default,,0000,0000,0000,,Which generate random numbers. Dialogue: 0,0:21:20.27,0:21:24.11,Default,,0000,0000,0000,,So, this method became much shorter, and a lot faster. Dialogue: 0,0:21:25.53,0:21:38.60,Default,,0000,0000,0000,,As an example we have here a variant from a Unix flavor,\Nwirh a native call to his C code. Dialogue: 0,0:21:40.80,0:21:50.20,Default,,0000,0000,0000,,And this is C++, which with its object orientation maps a bit better to Java. Dialogue: 0,0:21:51.25,0:21:55.34,Default,,0000,0000,0000,,And just for the fun of it, we can look at the Win32 variant. Dialogue: 0,0:21:55.34,0:22:01.69,Default,,0000,0000,0000,,And this just throws an exception, that this \Nmethod isn't supported on Win32. Dialogue: 0,0:22:03.36,0:22:08.84,Default,,0000,0000,0000,,Oh no! The Guru meditation! Dialogue: 0,0:22:09.22,0:22:12.51,Default,,0000,0000,0000,,Not at all planned.\NOh no. How annoying. Dialogue: 0,0:22:12.51,0:22:20.05,Default,,0000,0000,0000,,Another problem i had,\Nwas how these threads are handled. Dialogue: 0,0:22:20.05,0:22:30.13,Default,,0000,0000,0000,,I experienced some problem when adding network support Dialogue: 0,0:22:31.56,0:22:37.65,Default,,0000,0000,0000,,I started a Java program\Nwhich opens a socket Dialogue: 0,0:22:38.56,0:22:43.40,Default,,0000,0000,0000,,And this socket should talk to some other server, and send data to it. Dialogue: 0,0:22:43.86,0:22:53.63,Default,,0000,0000,0000,,And I thought it might be nice to put in its own thread,\Nso the main thread can do other stuff. Dialogue: 0,0:22:54.37,0:23:00.21,Default,,0000,0000,0000,,We create a socket,\Nand a new thread. Dialogue: 0,0:23:00.98,0:23:06.00,Default,,0000,0000,0000,,And then I try to read from the socket here. Dialogue: 0,0:23:07.07,0:23:13.88,Default,,0000,0000,0000,,But then I got this error:\Napparently, the socket, isn't a socket! Dialogue: 0,0:23:14.74,0:23:16.43,Default,,0000,0000,0000,,Much strange. Dialogue: 0,0:23:21.24,0:23:25.08,Default,,0000,0000,0000,,But if you read the Amiga docs... Dialogue: 0,0:23:25.08,0:23:33.46,Default,,0000,0000,0000,,You'll find that this socket \Nonly exists within this process. Dialogue: 0,0:23:33.46,0:23:42.28,Default,,0000,0000,0000,,There are ways to circumvent this,\Nthey are bit troublesome. Dialogue: 0,0:23:42.56,0:23:51.100,Default,,0000,0000,0000,,So instead I here created a \Nnew socket process. Dialogue: 0,0:23:51.100,0:24:01.04,Default,,0000,0000,0000,,So instead of sending the socket ID, I instead send \Na reference to the process. Dialogue: 0,0:24:01.30,0:24:17.36,Default,,0000,0000,0000,,We'll continue with these threads. Dialogue: 0,0:24:18.09,0:24:24.61,Default,,0000,0000,0000,,I mentioned that JamVM uses Posix-thread,\Nwhere AmigaOS has processes. Dialogue: 0,0:24:25.13,0:24:38.50,Default,,0000,0000,0000,,Posix-threads are a bit more lightweight than AmigaOS' processes. Dialogue: 0,0:24:38.50,0:24:46.24,Default,,0000,0000,0000,,The AmigaOS processes has a few connections to DOS library and such. Dialogue: 0,0:24:46.24,0:24:52.20,Default,,0000,0000,0000,,Audience question: do they still have all that old DOS stuff, like BCPL and processes. Dialogue: 0,0:24:52.45,0:24:55.30,Default,,0000,0000,0000,,It's sort of all gone in Amiga OS 4. Dialogue: 0,0:24:55.30,0:24:58.71,Default,,0000,0000,0000,,Audience: they had these heavy processes, and then "threads". Dialogue: 0,0:24:58.71,0:25:02.86,Default,,0000,0000,0000,,Ah, yes, yes, that's still there. Dialogue: 0,0:25:02.86,0:25:15.85,Default,,0000,0000,0000,,An AmigaOS process is a "task", which is more lightweight.\NBut the Amiga process has connections to DOS. Dialogue: 0,0:25:15.85,0:25:28.46,Default,,0000,0000,0000,,And the "tasks" can't be used for disk I/O, so if you need that, you need a "process". Dialogue: 0,0:25:32.87,0:25:43.74,Default,,0000,0000,0000,,Here we've started a simple Java class, "Start thread", that actually doesn't start a thread. Dialogue: 0,0:25:45.27,0:25:49.50,Default,,0000,0000,0000,,We're going to see how this looks when its running on the Amiga Dialogue: 0,0:25:50.26,0:26:09.23,Default,,0000,0000,0000,,Each new JVm instance, has beside the main process,\Nalso have three JamVM specific Amiga processes. Dialogue: 0,0:26:09.23,0:26:12.69,Default,,0000,0000,0000,,We have a Reference handler, Finalizer, and Signal handler. Dialogue: 0,0:26:12.69,0:26:23.19,Default,,0000,0000,0000,,Reference handler handles garbage collection, i.e. frees created objects. Dialogue: 0,0:26:23.90,0:26:29.86,Default,,0000,0000,0000,,The Finalizer runs the "finalize()" method on objects that's been garbage collected. Dialogue: 0,0:26:30.26,0:26:34.29,Default,,0000,0000,0000,,And the Signal handler handles signals sent to the program. Dialogue: 0,0:26:35.31,0:26:38.86,Default,,0000,0000,0000,,So it kind of looks like this. Dialogue: 0,0:26:39.80,0:26:48.88,Default,,0000,0000,0000,,And now I'm going to end this, \Nso why not try and end this Java program by pressing Ctrl-C. Dialogue: 0,0:26:48.88,0:26:53.02,Default,,0000,0000,0000,,Ctrl-C is handled by the signal handler. Dialogue: 0,0:26:57.34,0:27:06.42,Default,,0000,0000,0000,,And when it gets the Ctrl-C it executes the Java method System.exit and VMRuntime.exit(). Dialogue: 0,0:27:06.42,0:27:12.12,Default,,0000,0000,0000,,And then it also executes the native c-function exit(). Dialogue: 0,0:27:12.12,0:27:22.47,Default,,0000,0000,0000,,The problem with running exit(), is that only the Signal handler process is ended. Dialogue: 0,0:27:23.84,0:27:28.01,Default,,0000,0000,0000,,Like i said, Amiga processes are a bit bigger than Posix-threads. Dialogue: 0,0:27:28.29,0:27:35.46,Default,,0000,0000,0000,,If this was Posix-threads, an exit() would've ended the main process,\Nwhich would've ended the Posix-threads aswell. Dialogue: 0,0:27:35.93,0:27:38.46,Default,,0000,0000,0000,,But not in the Amiga case. Dialogue: 0,0:27:39.38,0:27:45.28,Default,,0000,0000,0000,,So instead, we run the Java methods in the Signal handler. Dialogue: 0,0:27:45.28,0:27:49.68,Default,,0000,0000,0000,,And then we send the Ctrl-C signal back to the main process. Dialogue: 0,0:27:51.25,0:27:58.94,Default,,0000,0000,0000,,Receiving that signal, the main process ends the three subprocesses,\Nfrees memory,closes libraries, and then exists. Dialogue: 0,0:28:01.63,0:28:04.94,Default,,0000,0000,0000,,And with that, I'm almost done. Dialogue: 0,0:28:06.04,0:28:13.80,Default,,0000,0000,0000,,Current status: Jamiga is at version 1.2, downloadable from http://www.os4depot.net. Dialogue: 0,0:28:15.71,0:28:19.83,Default,,0000,0000,0000,,There's also a few automatic updates available. Dialogue: 0,0:28:20.33,0:28:29.65,Default,,0000,0000,0000,,Somewhat completet support for Java 1.5,\Nhowever no graphics or AWT. Dialogue: 0,0:28:33.85,0:28:40.63,Default,,0000,0000,0000,,I also have a small Twitter client,\Nwhich uses Twitter4j.jar Dialogue: 0,0:28:41.66,0:28:48.74,Default,,0000,0000,0000,,Its very simple, this is a command line tool you can run, Dialogue: 0,0:28:48.74,0:28:52.35,Default,,0000,0000,0000,,which creates a small tweet. Dialogue: 0,0:28:52.35,0:28:56.43,Default,,0000,0000,0000,,Fantastic! The technology moves forward, even for the Amiga. Dialogue: 0,0:28:57.48,0:29:02.48,Default,,0000,0000,0000,,The plan ahead is to support OpenJDK Dialogue: 0,0:29:02.89,0:29:11.18,Default,,0000,0000,0000,,And this a small test i ran, which shows that I'm missing java.libraray,\Nwhich I must implement. Dialogue: 0,0:29:12.11,0:29:17.19,Default,,0000,0000,0000,,JamVM supports OpenJDK, out of the box. Dialogue: 0,0:29:18.64,0:29:23.92,Default,,0000,0000,0000,,I'll also try to fix graphics stuff. Dialogue: 0,0:29:27.34,0:29:32.12,Default,,0000,0000,0000,,Just to mention a few ways to build OpenJDK. Dialogue: 0,0:29:32.48,0:29:38.62,Default,,0000,0000,0000,,You can either build it like Oracle wants you to. Dialogue: 0,0:29:39.03,0:29:49.74,Default,,0000,0000,0000,,One though I had was to build OpenJDK, grab the class files, and then just iteratively see what's missing. Dialogue: 0,0:29:50.57,0:30:03.66,Default,,0000,0000,0000,,Alternatively, you can build it using IcedTea,\Nwhich is a way to build OpenJDK using free GNU tools. Dialogue: 0,0:30:03.93,0:30:10.34,Default,,0000,0000,0000,,When you're building using OpenJDK, I think there's still some thing that aren't completely open source. Dialogue: 0,0:30:10.60,0:30:13.19,Default,,0000,0000,0000,,If I'm not mistaken. Dialogue: 0,0:30:14.36,0:30:19.31,Default,,0000,0000,0000,,With IcedTea, you can also do cross compiles, so i can compile Jamiga-stuff on that. Dialogue: 0,0:30:19.31,0:30:25.99,Default,,0000,0000,0000,,Otherwise I have to compile everything on the Amiga, and it actually isn't that fast. Dialogue: 0,0:30:27.87,0:30:31.77,Default,,0000,0000,0000,,And that's where I am right now. Dialogue: 0,0:30:32.25,0:30:42.18,Default,,0000,0000,0000,,If you want more information, you can follow me on twitter or look at my blog.\NIf you want info on Amiga, you can go to http://amigaos.se Dialogue: 0,0:30:43.91,0:30:47.21,Default,,0000,0000,0000,,That's it. Thank you!\NQuestions? Dialogue: 0,0:30:47.71,0:30:54.44,Default,,0000,0000,0000,,Audience: what was the biggest challenge? Is it this with the threads? Dialogue: 0,0:30:54.44,0:31:05.16,Default,,0000,0000,0000,,Currently its cross-compiling OpenJDK, but previously it was... Dialogue: 0,0:31:05.16,0:31:17.63,Default,,0000,0000,0000,,... mostly time... to find the time to fix everything. Dialogue: 0,0:31:17.63,0:31:27.17,Default,,0000,0000,0000,,Much of the work isn't very advanced, but it's\Nthese sort of bugs that is the hardest part. Dialogue: 0,0:31:27.77,0:31:42.07,Default,,0000,0000,0000,,Audience: what is the process model on the new Amiga? Back in the days, \Nall memory was shared, and you could peek wherever you wanted. Dialogue: 0,0:31:43.05,0:31:49.00,Default,,0000,0000,0000,,It's not possible to do that anymore, if you do that, the Grim Reaper will appear. Dialogue: 0,0:31:49.25,0:31:57.99,Default,,0000,0000,0000,,Audience: But wasn't that the case in Os 3.1. You could enable the MMU somehow. Dialogue: 0,0:31:57.99,0:31:59.58,Default,,0000,0000,0000,,Eh... er... Dialogue: 0,0:31:59.85,0:32:10.07,Default,,0000,0000,0000,,Yes, that's correct. Dialogue: 0,0:32:10.48,0:32:14.93,Default,,0000,0000,0000,,Audience: but the model was to send pointers. Dialogue: 0,0:32:15.77,0:32:19.10,Default,,0000,0000,0000,,Yes, er, that's still kind of like it is. Dialogue: 0,0:32:19.10,0:32:24.38,Default,,0000,0000,0000,,When you allocate memory, you can tell it to be"public" so other processes can reach it. Dialogue: 0,0:32:24.38,0:32:29.33,Default,,0000,0000,0000,,But you can also say that it's private, which is the preferred way. Dialogue: 0,0:32:29.33,0:32:35.58,Default,,0000,0000,0000,,But when two processes need to talk to each other, the memory needs to be "public". Dialogue: 0,0:32:35.58,0:32:38.49,Default,,0000,0000,0000,,Audience: and "public" is globally, shared? Dialogue: 0,0:32:38.69,0:32:42.06,Default,,0000,0000,0000,,Yes. Dialogue: 0,0:32:42.73,0:32:54.53,Default,,0000,0000,0000,,Audience: Have you found functions not available on Amiga? You mentioned the crypto-secure-random.... Dialogue: 0,0:32:55.12,0:33:01.25,Default,,0000,0000,0000,,Audience: ...but have you found something where you had to port a third party library. Dialogue: 0,0:33:01.63,0:33:09.38,Default,,0000,0000,0000,,no.. no.. well. Dialogue: 0,0:33:09.38,0:33:15.73,Default,,0000,0000,0000,,The JVM and GNU Classpath has a few dependencies, but most them are available. Dialogue: 0,0:33:16.02,0:33:18.89,Default,,0000,0000,0000,,Or, well, the Posix-threads doesn't exist. Dialogue: 0,0:33:19.12,0:33:23.93,Default,,0000,0000,0000,,Or, there is a support for Posix-threads, but that implementation lacks a few things. Dialogue: 0,0:33:23.93,0:33:27.42,Default,,0000,0000,0000,,So I made my own Posix-thread implementation which is very Jamiga specific. Dialogue: 0,0:33:27.42,0:33:33.76,Default,,0000,0000,0000,,So you can't use anywhere you like, sadly, \Nbut it works for JAmiga. Dialogue: 0,0:33:34.75,0:33:41.79,Default,,0000,0000,0000,,Audience: You mentioned AWT, but why not SWT? Dialogue: 0,0:33:42.85,0:33:51.57,Default,,0000,0000,0000,,Er... SWT.... isn't that Swing in the background? Or is that AWT? Dialogue: 0,0:33:51.95,0:34:07.43,Default,,0000,0000,0000,,Audience: SWT has its own native libraray, and is nät oart of the java standard. Dialogue: 0,0:34:07.91,0:34:14.98,Default,,0000,0000,0000,,Audience: so SWT isn't standard, and that's why you don't mention it? Dialogue: 0,0:34:15.51,0:34:38.91,Default,,0000,0000,0000,,Audience: (some discussion on SWT, AWT, etc): SWT is horrible. Don't go there. Dialogue: 0,0:34:39.40,0:34:42.37,Default,,0000,0000,0000,,Sounds like I shouldn't bother with SWT... atleast not now. Dialogue: 0,0:34:42.91,0:34:49.46,Default,,0000,0000,0000,,Audeince: Do you have any more commiters in the project? Dialogue: 0,0:34:49.46,0:34:58.23,Default,,0000,0000,0000,,I had one who helpd with some MorphOS parts, but, no, now its just me. Dialogue: 0,0:34:58.82,0:35:03.95,Default,,0000,0000,0000,,And lately, it's not been much from me either. Dialogue: 0,0:35:04.24,0:35:07.49,Default,,0000,0000,0000,,Audeince: What about test code. Does Rocale have that? Dialogue: 0,0:35:07.49,0:35:17.32,Default,,0000,0000,0000,,Yes... Oracle has some test-sets, JTreg I think its called.\NI haven't looked at that much. Dialogue: 0,0:35:17.32,0:35:23.89,Default,,0000,0000,0000,,However, GNU Classpath has "Mauve", which is an entire test suite for all Java classes. Dialogue: 0,0:35:24.20,0:35:36.32,Default,,0000,0000,0000,,If you look at my blog, I've listed what is tested,\Nand I think like 80 % is covered. Dialogue: 0,0:35:37.73,0:35:40.27,Default,,0000,0000,0000,,But, yes. Test suite exists. Dialogue: 0,0:35:44.42,0:35:46.35,Default,,0000,0000,0000,,Thank you! Dialogue: 0,0:35:48.30,0:35:51.10,Default,,0000,0000,0000,,A movie by Joel Edberg