Page 1 of 1
OOP & FreePascal
Posted: Mon Dec 18, 2006 6:59 pm
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
Posted: Thu Dec 21, 2006 5:56 am
by kazio0
Posted: Thu Dec 28, 2006 4:48 pm
by Assembler
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
Posted: Thu Dec 28, 2006 5:20 pm
by Assembler
Brynet-Inc wrote:Don't be rude
.. The person might not of understood what OOP was..
Sorry
Brynet-Inc wrote:In regards to your rudeness, I'll return the favour!!
Pascal for OSDev is lame!
Who said its not
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
Posted: Thu Dec 28, 2006 5:57 pm
by earlz
umm good luck with that, btw you might work on world peace while your at it
lol..
Posted: Thu Dec 28, 2006 6:24 pm
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.
Posted: Fri Dec 29, 2006 4:02 am
by Combuster
Assembler wrote:You may be impressed if you knew that i will write an example kernel in Basic too using FreeBasic compiler
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
).
@Brynet-inc: May i ask you once again, PLEASE STOP CHARGING AT PEOPLE BASED ON THEIR OPINION. You are just too predictable.
Posted: Fri Dec 29, 2006 5:23 am
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
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.
Posted: Fri Dec 29, 2006 8:07 am
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.
Posted: Fri Dec 29, 2006 8:57 am
by Brendan
Hi,
Brynet-Inc wrote:I've never had to respect peoples
feelings in the past, I'm not about to start now
I'd recommend learning at least a little common decency....
BTW, sorry about your posts (I think I "accidentally" deleted them).
Cheers,
Brendan
Posted: Fri Dec 29, 2006 9:23 am
by inflater
BTW, sorry about your posts (I think I "accidentally" deleted them)
Way to go!
(just kidding ? NO
)
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 &...
btw., here are some things for a 16-bit Pascal OS, you are welcome to visit
just try to enjoy my beautiful English translation
I think you wouldn't.
www.portixos.tk is back in business
inflater
Posted: Fri Dec 29, 2006 11:57 am
by Brynet-Inc
@Brendan, Not a chance..
Suppressing the truth eh? Nice work.. You're a real.. Wait whats another word for Donkey?
@inflater, I use C not C++.. Also you can disable those "weird prefixes" with
.intel_syntax noprefix.
Posted: Fri Dec 29, 2006 12:01 pm
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..
Posted: Fri Dec 29, 2006 10:38 pm
by Brendan
Brynet-Inc wrote:@Brendan, Not a chance..
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