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.
Pascal Kernel
Re:Pascal Kernel
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
*******************************************
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
Re:Pascal Kernel
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.
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.
Re:Pascal Kernel
Thank's ASHLEY4, this is a good code.
If you want, please send me the dos1.tpu file
If you want, please send me the dos1.tpu file
Re:Pascal Kernel
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
***************
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
Re:Pascal Kernel
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
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