OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:41 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: C TO DELPHI
PostPosted: Sat Dec 25, 2021 2:02 am 
Offline

Joined: Sat Feb 21, 2015 10:39 am
Posts: 20
Topic closed


Last edited by ekremkocak on Mon Dec 27, 2021 8:56 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Sat Dec 25, 2021 3:01 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
The conversion is trivial. What in particular are you having trouble with?

May I add that this code is pretty poor. It does not take care of alignment properly, and it statically allocates the memory pool. And to a really small size. The code has no way to take advantage of any additional memory installed. The best-fit algorithm is going to be very slow, and since there is currently no code to unify adjacent freed memory blocks, the whole thing will fragment itself into oblivion.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Sat Dec 25, 2021 5:23 am 
Offline

Joined: Sat Feb 21, 2015 10:39 am
Posts: 20
Topic closed


Last edited by ekremkocak on Mon Dec 27, 2021 8:57 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Sat Dec 25, 2021 11:51 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
Again, what, in particular, are you having trouble with? Or are we just supposed to do your homework for you?

Also, are you aware that at least FreePascal has extensions to enable calling a C function from Pascal, and I am sure Delphi also provides that if you prod it enough? So what is even the point of such translation except academic exercise?

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Sun Dec 26, 2021 9:20 am 
Offline
Member
Member

Joined: Mon Jul 07, 2008 1:25 am
Posts: 196
There are many OS's written in FreePascal which would give you a good place to start looking for what you need - however, I'd strongly suggest trying to write this from scratch rather than just copying/translating code from other people. There is far more learning in writing from scratch and then comparing than the other way around.

If you are interested here is the base of an OS I was building in FreePascal many years ago - perhaps it is useful to you for learning. https://github.com/system123/gizmicos.git

_________________
Gizmic OS
Currently - Busy with FAT12 driver and VFS


Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Sun Dec 26, 2021 10:53 am 
Offline

Joined: Sat Feb 21, 2015 10:39 am
Posts: 20
Topic closed


Last edited by ekremkocak on Mon Dec 27, 2021 8:57 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Sun Dec 26, 2021 11:35 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
ekremkocak wrote:
Friends, there are dozens of examples in c and FreePascal, but unfortunately there are no examples made with Delphi. I am trying to write in delphi.


Thing is, Delphi isn't a language, it is a compiler, IDE, and RAD tool for Object Pascal - the same language which FreePascal is a compiler for (there is a corresponding IDE for FreePascal, called Lazarus, but it is a separate project). FreePascal was developed to be closely compatible with Delphi code, as well.

While there are some differences (since FreePascal also supports a few other Pascal dialects), for the most part Delphi and FreePascal can compile the same code.

Does Delphi have a freestanding mode, though? I was always under the impression that Delphi (unlike FreePascal) was Windows-specific and could not generate freestanding code, which is necessary for OS development. If it does, all good, I just wasn't aware if it did or not.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Sun Dec 26, 2021 12:12 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
ekremkocak wrote:
Friends, there are dozens of examples in c and FreePascal, but unfortunately there are no examples made with Delphi.

Do you suppose there is a reason for that?


Top
 Profile  
 
 Post subject: Re: C TO DELPHI
PostPosted: Tue Dec 28, 2021 7:17 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
Op, why did you wipe out all your posts content and replace it with "Topic closed"? For one, you can't "close" a topic -- only moderators/administrators can do that, and from what I can tell your not either of those. And two, it makes it impossible for anyone to know what you wrote before (this forum isn't a wiki after all). Which means that anyone who comes across this topic has to try and figure out what you initially wrote before you wiped out all the content in your posts for no reason.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: SemrushBot [Bot] and 65 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group