• Recent Tutorials

  • Up is down - Baremetal Programming & Pascal as Low As It Gets

    In the lead up to the next propper tutorial I am planning to post - to do with linux and a lot less layers of code between the programmer and the bare silicon of the platform I came across an old, derelict project of mine which I had once dubbed HeliOS - and as you may have guessed by the CaMeLcAse there its an OS which just happened to fit in with the word helios - the sun god/deity. Reading through brought back the memories of coding and the question of 'how much faster would it be, if the program ran alone on the computer?'. An OS dedicated to running native pascal code. Shiny.


    Or rather not so. It needed to be compiled with some weird directives, it refused to work with grub correctly - had its roots far too sunk into the barebones of the OSDEV wiki and lacked much core functionality. The original intention was to have it run a very basic UI which coud shift a few pixels and run pascal code as fast as the hardware could

    I'll take my time now and say this: OS development is not for the fainthearted - I had all hell getting things booted and since grub won't work your more or less with
    Code:
     qemu -kernel kernel.obj
    for running anything but here goes - If anyone out there wants to run their own code as a standalone OS I'm putting up this basic manual of how to go about things if thats what you want to do.

    Comments 5 Comments
    1. chronozphere's Avatar
      chronozphere -
      Impressive! I didn't know that this was possible using pascal. Although its not really necessary, since we allready have linux, its great to play with :-D

      I fear that I won't have any time for it though.
    1. code_glitch's Avatar
      code_glitch -
      Its true we have linux - but lets say you needed to calculate some numbers of pi as fast as you could with zero overhead (or only a few bytes of it ).

      As a concept though, I think this demonstrates the true power of pascal - I've heard all too many critiques of it saying its too high level, no direct memory management and how limiting managed pointers can be. This, though, is the transformation of 'theoretically' to a much more practical approach to saying: it may be high level, but give it a line or two of ASM, tell the compiler to scrap the beautification and off you go: baremetal programming

      It is a shame the OSDev site only goes as far as basic VGA - if we had opengl drivers/code available I would have been able to compile prometheus and that could have been a sight to behold. Although I have not given up on the idea of finding some ATI docs on the matter and looking if there is any common ground between the driver .so files procedure wise. Because if that is the case it may be possible to scrap together a quick and dirty solution to the OpenGL solution. Still looking into this a bit at a time as it were.
    1. Ñuño Martínez's Avatar
      Ñuño Martínez -
      Man, I was looking for something like this for decades. Actually. Thank you for make it public!
    1. code_glitch's Avatar
      code_glitch -
      Nuno: No problem at all... I was actually getting worried by the silence of the comments box I'd posted one of the few topics no one needed/was interested in

      At least now its helped at least one person I am more or less satisfied...
    1. Ñuño Martínez's Avatar
      Ñuño Martínez -
      Quote Originally Posted by code_glitch View Post
      At least now its helped at least one person I am more or less satisfied...
      You know: Tanenbaum's book is so complex... I know your HeliOS isn't a full kernel but it helps to understand and testing ideas and so.