Marco van de Voort marcov at stack.nl
Thu May 5 15:27:46 CEST 2005

> 1. The very basic problem is with the video driver. Whenever I try to write
> to the Video memory either there is no reponse, or I receive a run time
> error 216. I tried all possibilities of using an absolute array, pointers,
> and even FillWord, nothing works out.
> 2. Since my Operating System will be Object Oriented, the compilation
> consists of calling a FPC_HELP_CONTRUCTOR which in turn calls the built in
> AsmGetMem function. But during the system initialization process there will
> be no memory manager. Is there a possiblity of constructing an object at a
> predetermined location like in C++?

1) use TP objects instead of classes
2) (better) provide an own startup temporary memmanager.

> Var x, y: Byte
> Procedure ClrScr; Assembler; [Public, Alias: 'CLRSCR'];
> mov edi, $B8000
> mov  eax, $07200720
> mov  ecx, 2000
> rep
> stosw
> mov  x, 0
> mov  y, 24
> End;
> This piece of code always gives a RTE 216.

You write a lot of bytes to %ds:[$B8000]. Since you are writing an OS, the
selectors could be setup in a multitude of ways. Are you sure you mapped the
videocard memory to that location? I suggest to check your early OS bootup
code how you enter protected mode and set up the selectors.

E.g. under dos the videocard memory is in $B8000 in the real mode segment
(which is %fs:$B8000 under Go32v2 typically), but if you didn't setup
the selector in your bootloader, it is pretty much random.

More information about the fpc-pascal mailing list