1. The Java runtimes provides a set of standard system libraries for use by prog
ID: 440730 • Letter: 1
Question
1. The Java runtimes provides a set of standard system libraries for use by programs. To what extent are these libraries similar to the system calls of an operating system, and to what extent are they different? 2. Suupose the hardware interval timer only counts down to zero before signaling an interrupt. How could an OS use the interval timer to keep track of the time of day? 3. How much video RAM is needed to support a 25 line X 80 row character monochrone text screen. How much is needed for a 1024 x 768 24-bit color bitmap? That was the cost of this RAM in 1985 and how much is it now? 4. List some challenges an operating system faces when passing parameters between user and kernel mode. Describe how an operating system can overcome them? 5. What are the differences between a trap and an interrupt? What is the user of each function? 6. What are the advantages and disadvantages of have a virtual personal computer? How much resources did you use to install virutal box on your personal computer?Explanation / Answer
0 down vote Java's standard library often has a similar feature set compared to the native library but there are several important differences. Java is Object Oriented, whether you like it or not. The advantage of this is that certain concepts are easier to manage. For example, most file related operations are found directly in the File object. Compare this to Posix, where a FILE is a handle which is really just a number; an index into your process's open file list. The Posix approach is very close to how the OS actually implements stuff. But in Java you don't see that or know it or care. Java has certain lowest-common-denominator behaviours in certain cases. There are many AWT APIs that are the way they are because AWT needed to be identical on a number of separate platforms. That turned out to be madness, and Sun quasi-deprecated most of AWT, because supporting platform equally meant supporting every platform crappily. The newer library, Swing, implements almost everything in pure Java, and thus is far better at cross-platform stuff, and thus has a richer API. And that API is very different from the native windowing library. Also, Swing doesn't integrate too well because it uses so little of the native OS. Java has certain limitations that the native libraries don't have. For example, you don't have function pointers. Thus you have Listeners and Runnable and other Java patterns for doing things that in C++ would involve function pointers. So any API that needs one of these features will be significantly different in Java than in the native OS.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.