Page 1 of 1

Implementing a HLL in an OS

Posted: Wed Dec 19, 2007 7:23 pm
by thegreatseph
I have been working on an operating system for a while now, I have a fair amount of the Kernel done and a boot loader finished. The problem is the entire point of the OS is to make an operating system written in pascal and up to this point it is written in 80x86 asm (NASM).

So I need to start either implementing DOS interrupt services in order to use Turbo Pascal 7.0 or Find some Pascal Compiler (preferably as TP as possible in syntax) that does not use DOS interrupt services.

The first option would really mean I need GPL'd code that has DOS compatible services in ASM. I think FreeDOS implements them in C (I think) but there might be some code out there that I don't know about.

as far as the second option I know that plenty of people seem to be using GCC to implement operating systems, and it doesn't seem that they are having to rewrite linux/unix in order to use it, so is it possible to use something like Gnu Pascal to do something similar?

Posted: Wed Dec 19, 2007 8:30 pm
by astrocrep
Welcome to the forum...

I will advise to always search, and check the wiki too...

http://www.osdev.org/wiki/Pascal

Again welcome to the forum and best of luck with your os!

-Rich

Posted: Wed Dec 19, 2007 8:48 pm
by Dex
Here some pointer that may help you, first there is a way to gey TP to use BIOS instead of Dos, for some functions.
Example:

Code: Select all

program PascalOS;
 BEGIN
  WriteLn('Hello world from my OS ');
  Readln; 
END.
The above users Dos int's, but this users BIOS.

Code: Select all

program PascalOS;
uses Crt;

 BEGIN
  WriteLn('Hello world from my OS ');
  Readln; 
END.
You can boot code like this using BootProg a boot loader that loads exe from a floppy or hdd, see here: http://alexfru.chat.ru/epm.html#bootprog

Now for the Dos clone, i written one as a OS tut in asm, it very basic, but it will be simple to understand, it's call MiniDos you can get it here:
http://board.flatassembler.net/topic.php?t=5275&start=0

You can also go here: http://alexfru.narod.ru/emiscdocs.html
under "Pascal Related Docs" get "RTL sources for BP 7.0" these are the asm RTL you can find any that use Dos int's and write a BIOS ver, that what i did, but i have since lost the modded RTL.

Here's my very first attempt at a pascal OS many moons a go :oops:

Posted: Wed Dec 19, 2007 11:18 pm
by thegreatseph
Thank you this is the type of information I have been looking for. I see now from looking at the RTL source which units I can and cannot use.