Hi All,
i'm need a compiler wich outputs raw binary 16bit code for
realmode kernel, but i don't know how to make it in Turbo C 3.1.
Seems that the C preprocessor can not be overwritten....
Does anybody know how to do this? Can i even use Pascal?
Thanx in advance
16bit kernel what compiler????
Re: 16bit kernel what compiler????
You need a linker which outputs flat binary. TC can do this, by getting the linker to output a .COM file (IIRC you need to use the tiny memory model and give the linker the /t switch, but check up on that).
A drawback of using the tiny model with 16-bit code is that the compiler will output code that can access a maximum of 64KB (code, data and stack combined). If you're writing a real-mode OS, you might want to write your loader as a .COM program (which can be run off a boot floppy or even from the DOS command line) and get it to load the kernel which is in a special format.
A drawback of using the tiny model with 16-bit code is that the compiler will output code that can access a maximum of 64KB (code, data and stack combined). If you're writing a real-mode OS, you might want to write your loader as a .COM program (which can be run off a boot floppy or even from the DOS command line) and get it to load the kernel which is in a special format.
Re: 16bit kernel what compiler????
Thanx for your help, but i know that...my problem is that the linker outputs a .com file with dos-system calls at the start
(C StartUpCode) but how can i default this?
(C StartUpCode) but how can i default this?
Re: 16bit kernel what compiler????
You'll need to override the startup assembly code that your compiler uses.
For an example, see Chris Giese's BING boot loader:
http://www.execpc.com/~geezer/os/bing.zip
Web page:
http://www.execpc.com/~geezer/os/
For an example, see Chris Giese's BING boot loader:
http://www.execpc.com/~geezer/os/bing.zip
Web page:
http://www.execpc.com/~geezer/os/
Re: 16bit kernel what compiler????
You can use TP7 or other free Tp compiler. Use a asm boot code, that loads a exe with MZ at the begining. So you write special procedures or functions in Tp that don't use dos.
Like:
procedure WriteChr(Chr: Char);
begin
asm
MOV Al, Chr
PUSHA
MOV Ah, 0Eh
INT 10h
POPA
end;
end;
You can test your progr
Like:
procedure WriteChr(Chr: Char);
begin
asm
MOV Al, Chr
PUSHA
MOV Ah, 0Eh
INT 10h
POPA
end;
end;
You can test your progr
Re: 16bit kernel what compiler????
am in dos and boot it with your boot code.
So you have to write functions to get on the disk and harddisk.
You can still use functions in TP that not use dos.
So you have to write functions to get on the disk and harddisk.
You can still use functions in TP that not use dos.
Re: 16bit kernel what compiler????
Like this you can use the pascal string unit to write the str with the writechr procedure.
procedure WriteStr(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 WriteStr(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;
Re: 16bit kernel what compiler????
Go to http://membres.lycos.fr/placr/os/picodos.html.
You can remove the interupts when you write then in Tp.
So the the boot code is very small.
You can remove the interupts when you write then in Tp.
So the the boot code is very small.
Re: 16bit kernel what compiler????
Thank you for the help!
But i need more information about exe-files...didnt found on web
how works the relocation? how can i load exe-files under TP?
Thanx!
But i need more information about exe-files...didnt found on web
how works the relocation? how can i load exe-files under TP?
Thanx!