Pascal Kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
cobrab

Pascal Kernel

Post by cobrab »

I want to write a kernel in Turbo Pascal, the problem is TP use DOS interrupts, and generate EXE files,

How is the form to generate COM files?

And what files I need to change in TP for use BIOS interrupts? (for example the writeln or readln functions).

Sorry for my english.
ASHLEY4.

Re:Pascal Kernel

Post by ASHLEY4. »

Try this:
*******************************************
procedure next_line;
begin
asm
MOV AH,3
INT 10h
MOV AH,2
INC DH
MOV DL,0
INT 10h
end;
end;


procedure WritelnA(Str: String);
var
Pos: Integer;
Chr: array[0..254] of Char;
begin
StrPCopy(Chr, Str);

for Pos := 0 to (Length(Str) - 1) do
begin
WriteChr(Chr[Pos]);
end;
next_line;
end;
procedure WriteA(Str: String);
var
Pos: Integer;
Chr: array[0..254] of Char;
begin
StrPCopy(Chr, Str);

for Pos := 0 to (Length(Str) - 1) do
begin
WriteChr(Chr[Pos]);
end;
end;
procedure hold;
begin
asm
PUSHA
XOR AX,AX
INT 16h
POPA
end;
end;
PROCEDURE CLS;
BEGIN
ASM
mov AH,2
mov BH,0
mov DX,0
int 16
mov AH,9
mov CX,2000
mov AL,' '
mov BL,7
int 16
mov AH,2
mov BH,0
mov DX,0
int 16
END;
END;
begin
writelnA('loading kernel 16 !'); {this prints string and move's next line}
hold; {stops till key pressed}
CLS; {clrscr}
writeA('hello world!'); {prints string does not move next line}
hold;
end.
******************************************
I use a loader that loads exe to load the pascal kernel.
\\\///
(@@)
ASHLEY4
ASHLEY4

Re:Pascal Kernel

Post by ASHLEY4 »

I also have a tpu called "dos1.tpu"
that if you include it ,lets you use the "setintvec" and "getintvec" to inplemant you interrupts etc.
I will send it you if you want.

\\\///
(@@)
ASHLEY4.
cobrab

Re:Pascal Kernel

Post by cobrab »

Thank's ASHLEY4, this is a good code.

If you want, please send me the dos1.tpu file
cobrab

Re:Pascal Kernel

Post by cobrab »

ASHLEY4:


What Pascal compiler use?
ASHLEY4

Re:Pascal Kernel

Post by ASHLEY4 »

I use turbo pascal 7 and tasm for assembly,The above code needs you to include this at the top of your prog:
***************
uses
strings;
**************
I forgot to put it in ,in the example :-[.
Here are some things that may help:

There is a demo Pascal OS made in freepascal,if you want 32-bit PM code:
http://www.thegaineys.fsnet.co.uk/
You can make programs has small as 300 bytes in
tp ,if you make a new "system.tpu".
If your making a real mode dos clone ,I have a USB.TPU
that will help to inplomant USB serport ;D
If you want it.

What is your OS in ?

\\\///
(@@)
ASHLEY4
cobrab

Re:Pascal Kernel

Post by cobrab »

I use Turbo Pascal 7.0 and NASM.

I work in the bootloader and in the kernel,
I want to create a OS in Real Mode.

Maybe In the future a Pmode OS.

the name is BK-OS ;D

I dont have web page
Post Reply