Hi All!
Ive been searching for ages for a tutorial for using Pascal as a language for
OS development. When I try to compile kernel.pas (from http://wiki.osdev.org/Pascal)
it generates the error: Can't find unit system used by kernel. However, the System unit isn't
in the uses list!
Any ideas, hope you can help!
Thanks, Matt.
Pascal language - Free Pascal Compiler Error!
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: Pascal language - Free Pascal Compiler Error!
What command are you using to compile the kernel?
There should be an option to disable automatic includes in the command line.
There should be an option to disable automatic includes in the command line.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: Pascal language - Free Pascal Compiler Error!
Heres the command i'm using:
fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -Rintel -Tlinux kernel.pas
Any Ideas?
Thanks, Matt.
fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -Rintel -Tlinux kernel.pas
Any Ideas?
Thanks, Matt.
Re: Pascal language - Free Pascal Compiler Error!
The system unit is automatically included whether you want it or not. This is theoretically where all the types and runtime routines are defined. Ofcourse some are defined by the compiler internally. But you'll have to supply a few. HResult must be defined for example
just make a system.pas like this:
unit system
interface
type
Cardinal = 0..$FFFFFFFF;
HResult = Cardinal;
implementation
end.
just make a system.pas like this:
unit system
interface
type
Cardinal = 0..$FFFFFFFF;
HResult = Cardinal;
implementation
end.
http://j-software.dk | JPasKernel - My Object Pascal kernel
Re: Pascal language - Free Pascal Compiler Error!
Don't forget to add {$FPC_IS_SYSTEM} directive or it will still try to add implicit uses System; statement.