OOP & FreePascal

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
User avatar
Assembler
Member
Member
Posts: 30
Joined: Fri Oct 27, 2006 5:26 am
Contact:

OOP & FreePascal

Post by Assembler »

Hello All,
First i'm not a pascal expert or going to use it in OS development.

I was wondering if FreePacal OOP can be used in OS development.

What functions needs to implemented in order to permit the usage of Objects and/or Classes ?

Do any one have a source for a simple kernel written in FreePascal's OOP ?

I'll appreciate that.
Thanks
Systems and Computer Engineering Researcher
"Do you pine for the nice days of Minix-1.1, when men were men and wrote their own device drivers?" -- Linus Torvalds
http://sce.carleton.ca/~maslan
kazio0
Posts: 4
Joined: Sat Dec 09, 2006 6:02 am

Post by kazio0 »

User avatar
Assembler
Member
Member
Posts: 30
Joined: Fri Oct 27, 2006 5:26 am
Contact:

Post by Assembler »

kazio0 wrote:Kazio0OS
http://os.kgb.pl - os written in freepascal

http://www.osdev.org/osfaq2/index.php/D ... n%20Pascal
Didn't u read my post, i'm asking about OS in OOP Pascal (Object, Classes & rest of OOP support) but u've posted a link about OS development in pascal which is not a trivial matter and has alot of information and web pages.

I know that i need to provide some built-in procedure/functions starting with prefix "fpc" in the rtl so as the getmem()/freemem(), new & dispose.

Thank you
Systems and Computer Engineering Researcher
"Do you pine for the nice days of Minix-1.1, when men were men and wrote their own device drivers?" -- Linus Torvalds
http://sce.carleton.ca/~maslan
User avatar
Assembler
Member
Member
Posts: 30
Joined: Fri Oct 27, 2006 5:26 am
Contact:

Post by Assembler »

Brynet-Inc wrote:Don't be rude :P.. The person might not of understood what OOP was..
Sorry :lol:
Brynet-Inc wrote:In regards to your rudeness, I'll return the favour!!

Pascal for OSDev is lame! 8)
Who said its not :lol:

I'm just writing a library containing low-level code, it yet works with C, Pascal and i wanted to test it with OOP pascal too, that's it.

You may be impressed if you knew that i will write an example kernel in Basic too using FreeBasic compiler :lol:
Systems and Computer Engineering Researcher
"Do you pine for the nice days of Minix-1.1, when men were men and wrote their own device drivers?" -- Linus Torvalds
http://sce.carleton.ca/~maslan
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

umm good luck with that, btw you might work on world peace while your at it :)
lol..
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Post by Ready4Dis »

hckr83 wrote:umm good luck with that, btw you might work on world peace while your at it :)
lol..
Hey, don't be so quick to judge, i've written a gui in basic, a 3d software engine, and a few other useless things that ran much faster once ported to a real langauge ;). Although basic that compiles to an exe instead of being interpreted really isn't any slower (ok, a tad because not as much work has been done on optimizing compilers for basic) than other high level languages. Supporting it isn't a bad thing, mostly useless imo, but still doesn't hurt.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Assembler wrote:You may be impressed if you knew that i will write an example kernel in Basic too using FreeBasic compiler :lol:
BASIC can very well be used in OS development. My own OS is proof of that. And BASIC makes a lot of things a lot easier.
Besides should you go for speed, assembly is imo the way to go. And in freebasic, you can inline that in pure intel syntax (now look at gcc 8)).

@Brynet-inc: May i ask you once again, PLEASE STOP CHARGING AT PEOPLE BASED ON THEIR OPINION. You are just too predictable.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Post by Ready4Dis »

While I have never used FreeBasic, intel asm does sound yummy :). I really wish someone would implement that into gcc, but I'm definitely not the guy to do it. All my assembly is stuck in other files, mostly due to trying to keep portability in mind, anything platform specific (and asm is included), is put into seperate files. If I put asm in my kernel in C, I would kill portability to other platforms, as is I shouldn't have to touch my kernel at all, just fill in some asm functions in the background, recompile and link, of course i haved played on other platforms yet, so I can't say for sure.

Anyways, lets not turn this into a war of languages, and stick to the original post. Does anybody know what is required to implement an OS in OOP Pascal? I'm sure it can be used, but I would think it would be similar to C++, where you have to fill in a bit extra functionality over the standard libraries. Basically any functionality that you want to use you will have to provide as a library :P If you want to be able to allocate/deallocate memory, you need a callback to your kernel or other module that can do such a thing, or write an allocation library for each application to link to. I'm not familiar with OOP Pascal, so I can't say everything you'll need, but should be very similar to Pascal with some more addons.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Post by distantvoices »

@combuster:
ha, i'd like to see that brynet-inc lad over there speaking to us that testy in real life. I wonder if he ain't just sneaking out of sight cuz of lack of guts.

Showing off with wanna-be-guts here is easy. I canna reach out for that git to slap him behind the ear so he wakes up.

So jist let'im talk and talk what soever he wants, we shouldna care. We've got nicer business around to deal with than this ... ah, I don't wanna cut in his kerf. At least, besides all gruffyness, I remain polite.

@Ready4Dis: I for one can't tell. I've never worked with pascal nor OOP Pascal, so I don't know. But I daresay, that you'd need at least some kind of basic runtime support for all the oop stuff. In c++ it's the runtime library way, if you want it in your own os.

@Brynet-Inc: *shrugs* I'd rather you grow up ere playing in these fields. Are you that testy in real life too? Do you dare to even hint at people that they are morons just coz you think so in real life, if looking them straight in the eye? Well, anyway, have it your way. After all I do not have to deal with you.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Post by Brendan »

Hi,
Brynet-Inc wrote:I've never had to respect peoples feelings in the past, I'm not about to start now :wink:
I'd recommend learning at least a little common decency....

BTW, sorry about your posts (I think I "accidentally" deleted them). :roll:


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post by inflater »

BTW, sorry about your posts (I think I "accidentally" deleted them)
Way to go! :D (just kidding ? NO :D)
Pascal for OSDev is lame!
Do you ever try it? The code is much understandable than C++ syntax, so how do you know that Pascal is bad for OSdev? You did not make any OS in BP! ;)
intel asm does sound yummy
Yes it does (for me :), I don't know about Brynet-Inc), it is better to use

MOV AX,1234h

and not some code with some weird prefixes, like % and &... 8)

btw., here are some things for a 16-bit Pascal OS, you are welcome to visit :) just try to enjoy my beautiful English translation :lol: I think you wouldn't. :D :D :D

www.portixos.tk is back in business :)

inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

@Brendan, Not a chance.. :roll:

Suppressing the truth eh? Nice work.. You're a real.. Wait whats another word for Donkey? 8)

@inflater, I use C not C++.. Also you can disable those "weird prefixes" with .intel_syntax noprefix.

:roll:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

...I say it all the time... you can do intel syntax using gas(gcc
try out this code:

Code: Select all

__asm(".intel_syntax noprefix\n"
"mov eax,0x483\n"
".att_syntax\n"); //if you don't set it back then gcc generates att code and gives errors..
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Post by Brendan »

Brynet-Inc wrote:@Brendan, Not a chance.. :roll:

Suppressing the truth eh?
The truth? I only saw offensive trolling...

Do me a favour - put OSdev.org and your username into your resume, so that potential employers (now and in the future) can see how talented you are....


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Locked