6 ms·
I'm going to give OP the benefit of the doubt on this one. A couple things worth noting, it successfully boots, does not cause a fault of any kind, and is in a
by TehCorwiz 13y ago
I'm going to give OP the benefit of the doubt on this one. A couple things worth noting, it successfully boots, does not cause a fault of any kind, and is in a position to interact directly with the bare metal. The tools that we use to interact with a *nix system are often just that, bits of code in user-space. This is a kernel-space program. That it does not do any of the memory management or device access yet doesn't mean it's not a kernel.
It might actually be interesting to take these techniques and apply them to something else. Maybe a demo, ala the demoscene, that runs on the bare metal. Maybe implement a game that doesn't have the overhead of an os.
This is less a finished product and more an inspiration. So often I think that people miss that about things. Sometimes things aren't done, sometimes they're just beginning.
- nsxwolf 13y agoReminds me of the old "booter" games on the PC that used their own kernel instead of MS DOS [1] It would be fun to see how far one could go with modern hardware. Writing your own driver for a modern graphics card sounds absolutely terrifying (and fun). [1] http://en.wikipedia.org/wiki/PC_booter http://en.wikipedia.org/wiki/PC_booter
- Intermernet 13y agoThis one was awesome: http://en.wikipedia.org/wiki/Buck_Rogers:_Planet_of_Zoom#Planet_of_Zoom_video_game http://en.wikipedia.org/wiki/Buck_Rogers:_Planet_of_Zoom#Pla... CGA graphics(!), and pushed the monophonic speaker on a basic XT further than anything I'd seen at the time. Unplayable on "turbo" mode :-)
- nsxwolf 13y agoI have a version of that on cartridge for my TI-99/4A!
- kyberias 13y agoCome on, no. It is not a kernel. It's a program that runs "on bare metal". Let me define what a piece of code needs to do to be a "kernel": it needs to manage some resources to allow other programs to run using those resources. E.g. memory, cpu time, I/O peripherals etc. You know a kernel when you see one.
- ertdfgcb 13y agoA kernel is a program that runs "on bare metal". This program is equivalent to hello world for kernels - it's the simplest possible one. It is called "Kernel 101", after all.
- greenyoda 13y agoA kernel may be a program that runs on bare metal, but not every program that runs on bare metal is a kernel. "With the aid of the firmware and device drivers, the kernel provides the most basic level of control over all of the computer's hardware devices. It manages memory access for programs in the RAM, it determines which programs get access to which hardware resources, it sets up or resets the CPU's operating states for optimal operation at all times, and it organizes the data for long-term non-volatile storage with file systems on such media as disks, tapes, flash memory, etc."[1] A program that prints "hello world" doesn't come close to meeting that description. [1] https://en.wikipedia.org/wiki/Operating_system#Kernel https://en.wikipedia.org/wiki/Operating_system#Kernel
- akiselev 13y agohttp://en.wikipedia.org/wiki/Microkernel http://en.wikipedia.org/wiki/Microkernel This isn't even a microkernel. This would at best be an example of firmware on an Intel/AMD x86/x64 booted from Grub that prints to the console. This code, however, doesn't do a single thing that other software expect even a microkernel to do (provide for basic scheduling, memory management if an MMU is available [which it is in this case], and IPC/FS).
- steveklabnik 13y agohttp://en.wikipedia.org/wiki/Exokernel http://en.wikipedia.org/wiki/Exokernel <- if you're playing the 'how big is a kernel' game.
- akiselev 13y agoAwesome link, thanks! The key part of any kernel can be expressed from this Exokernel definition: Exokernels are tiny, since functionality is limited to ensuring protection and multiplexing of resources, which are vastly simpler than conventional microkernels' implementation of message passing and monolithic kernels' implementation of abstractions. They have to, in some way shape or form, deal with conflicting requests for resources from their client applications (whether or not you have a concept of privileged or protected execution like on basic microcontrollers). I'd be curious to see how exokernels manage time unless each application implements its own scheduler and gives up control of execution.
- steveklabnik 13y agoThe generic answer to any question about exokernels is "In userspace." It also applies here: There's generally a userspace scheduler which programs can register themselves with. Or they can implement their own.
- Nav_Panel 13y ago> Maybe implement a game that doesn't have the overhead of an os. I'm in CMU's operating systems class right now and that was one of our projects (our second). The first was writing a stack-tracing debug library, the third was a user-space thread library built on top of a particular kernel spec, and then the fourth was to build a kernel basically from scratch, using our thread library as a test program. Here's a link to the spec for the game we built on the bare metal: https://www.cs.cmu.edu/~410/p1/proj1.html https://www.cs.cmu.edu/~410/p1/proj1.html That fourth project, or "p3" as it's known around here, is known to be a killer. It's tough to write a whole kernel in 6 weeks (+ 1 week of break), especially when it's expected to have a full virtual memory system, kernel tasks/threads for concurrent programming, program loading, interrupt handling, etc, even with a partner.
- TehCorwiz 13y agoWow, that's pretty cool. Thanks for the link.