Borland Pascal FLat Binary
Borland Pascal FLat Binary
Is there a way to compile Borland Pascal into a flat binary file so it can be loaded by a boot loader? Or do I need to code exe support to load the .exe kernel that is created?
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
- JackScott
- Member
- Posts: 1036
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- Matrix: @JackScottAU:matrix.org
- GitHub: https://github.com/JackScottAU
- Contact:
Re: Borland Pascal FLat Binary
Try compiling the Pascal into object files, and then using LD to link the executable proper. http://wiki.osdev.org/Pascal has more information (though the linking command is missed, it should be a fairly simple matter to convert the one in the other barebones... they are all *.o after all).
Re: Borland Pascal FLat Binary
Don't you dare to read that, it'll confuse you more. It's designed for Free Pascal, which is 32-bit.
There's no way of compiling that object files to .COM. Borland Pascal is proprietary, dated and it's designed to make programs for MS-DOS - the object files are 16-bit Microsoft OMF, which I really doubt LD supports (not to mention widely used 32bit versions, which LD lacks.. I think.).
If you desperately need to compile to COM, you need Pascal 1.0, but it's from 1980 or so. (Nothing like Object Pascal, USES, etc in P1.0.).
But it's relatively easy to run your EXE kernel - I've told you that in my e-mail. Just download Alexei frounze's Bootprog sector, again it's here:
http://alexfru.chat.ru/epm.html
Everything you need is to change the "LOADER BIN" to the file name of your compiled kernel and do NASM BOOT12.ASM and then BOOTABLE BOOT12.BIN A: or PARTCOPY. If you find that hard to understand, I suggest quit OSdeving and reading manuals.
There's no way of compiling that object files to .COM. Borland Pascal is proprietary, dated and it's designed to make programs for MS-DOS - the object files are 16-bit Microsoft OMF, which I really doubt LD supports (not to mention widely used 32bit versions, which LD lacks.. I think.).
If you desperately need to compile to COM, you need Pascal 1.0, but it's from 1980 or so. (Nothing like Object Pascal, USES, etc in P1.0.).
But it's relatively easy to run your EXE kernel - I've told you that in my e-mail. Just download Alexei frounze's Bootprog sector, again it's here:
http://alexfru.chat.ru/epm.html
Everything you need is to change the "LOADER BIN" to the file name of your compiled kernel and do NASM BOOT12.ASM and then BOOTABLE BOOT12.BIN A: or PARTCOPY. If you find that hard to understand, I suggest quit OSdeving and reading manuals.
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Re: Borland Pascal FLat Binary
Thanks I couldn't remember what that boot loader was called. I will give it a try. Do you have assembly code to call your kernel after the boot loader?
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Borland Pascal FLat Binary
The boot loader can load EXE's and binary files BTW.
If you're using Borland Pascal, you're good to go and you can start using WriteLn, ReadLn, ReadKey etc, without all that hard work programming your own video and keyb driver. Also you don't need any weird ASM stubs. The EXE header tells the boot sector where to load to.
Just don't forget to add CRT into your USES clausule and before that, download the patched CRT unit!
Again, the CRT unit is for transforming WriteLn, ReadLn, TextMode etc. to BIOS, which in real mode you can freely use. If you don't add CRT into the USES section, WriteLn and ReadLn need MS-DOS (INT 21h) to operate.
You need the patched CRT unit against the "runtime error 200", which occurs at machines faster than 200MHz.
If you're planning to do your kernel in Free Pascal, DISREGARD THIS ALL. Firstly, FP is 32-bit and you can't use BIOS functions there. You have to program everything from scratch, and you need to switch to protected mode by the boot sector/second stage boot loader, or in the ASM stub of your kernel BEFORE THE FUNCTION MAIN()
If you're using Borland Pascal, you're good to go and you can start using WriteLn, ReadLn, ReadKey etc, without all that hard work programming your own video and keyb driver. Also you don't need any weird ASM stubs. The EXE header tells the boot sector where to load to.
Just don't forget to add CRT into your USES clausule and before that, download the patched CRT unit!
Again, the CRT unit is for transforming WriteLn, ReadLn, TextMode etc. to BIOS, which in real mode you can freely use. If you don't add CRT into the USES section, WriteLn and ReadLn need MS-DOS (INT 21h) to operate.
You need the patched CRT unit against the "runtime error 200", which occurs at machines faster than 200MHz.
If you're planning to do your kernel in Free Pascal, DISREGARD THIS ALL. Firstly, FP is 32-bit and you can't use BIOS functions there. You have to program everything from scratch, and you need to switch to protected mode by the boot sector/second stage boot loader, or in the ASM stub of your kernel BEFORE THE FUNCTION MAIN()
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Re: Borland Pascal FLat Binary
Thanks. I am using Borland Pascal. So I don't need a keyboard driver or video driver? I have Patched CRT and I know how uses and things work. Do I still need the Boot loader to load protected mode and Interupts??
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Borland Pascal FLat Binary
Borland pascal is 16-bit. REAL MODE, no protected mode. Max. 640 kB of RAM to address. All segments divided to 64K parts.
PortixOS 0.4 with a second stage bootloader: Borland pascal. Unreal mode. Max. 4 GB RAM to address. CS and SS are 16-bit (64K limit like in real mode), everything else 4 GB limit.
The version I gave you is just the kernel, not the second stage b-loader.
'Nuff said. You seem to have a great magyar gulyash at OSdeving.
PortixOS 0.4 with a second stage bootloader: Borland pascal. Unreal mode. Max. 4 GB RAM to address. CS and SS are 16-bit (64K limit like in real mode), everything else 4 GB limit.
The version I gave you is just the kernel, not the second stage b-loader.
'Nuff said. You seem to have a great magyar gulyash at OSdeving.
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Re: Borland Pascal FLat Binary
What does 'magyar gulyash' mean?
Jules
Jules
Re: Borland Pascal FLat Binary
A mess, but in it's original meaning it's a Hungarian spicy dish.
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Re: Borland Pascal FLat Binary
You are confusing Borland pascal with Turbo pascal. Borland pascal actually offered protected mode with a proprietary extender, but I think it was still 16-bit protected mode, not 32-bit.inflater wrote:Borland pascal is 16-bit. REAL MODE, no protected mode.
JAL
Re: Borland Pascal FLat Binary
Yes, you're right, I've omitted that on purpose because - for the protected mode to work, you need "DPMI16BI.OVL", "RTM.EXE" and God knows what else. Plus it's an 16-bit pmode , you're right, but I didn't want to confuse System123 and other readers.jal wrote:You are confusing Borland pascal with Turbo pascal. Borland pascal actually offered protected mode with a proprietary extender, but I think it was still 16-bit protected mode, not 32-bit.inflater wrote:Borland pascal is 16-bit. REAL MODE, no protected mode.
JAL
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Re: Borland Pascal FLat Binary
I never got a version of Portix from you. I have started my kernel. Already boots fine and has a simple VESA mode which I added. Going to start Drivers soon. please mail me Portix.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Borland Pascal FLat Binary
Hmm, I apologize then for my posts above. Must've been a email server error or something, I don't know. (I've sent it to hughes etc etc at gmail).
Anyways I'll PM you with the source.
Anyways I'll PM you with the source.
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Re: Borland Pascal FLat Binary
Thanks. I am going to set up a second stage loader to boot in pmode and setup gdt and idt's
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Borland Pascal FLat Binary
Okay, but don't forget: BP is 16-bit, doesn't run in pmode (except with a dos extender)
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )