PASCAl or C
-
trey_monty
- Member

- Posts: 44
- Joined: Thu Mar 10, 2005 12:00 am
Re: PASCAl or C
I also just got a new OS writen in PASCAL.
Re: PASCAl or C
The only "real" reason not to code in Assembly should be that you don't want to.writing a whole OS in asm is possible but it's a very bad idea, coz it makes code maintaining herder, also, if you code your OS in assembly it will not be portable, coz assembly is arch. dependent
Come on, what makes you say that "code maintaining herder" ? I think that it's easier then GCC stupid syntax (esp. inline asm) which makes many C hobby OS'es source unreadable.
"also, if you code your OS in assembly it will not be portable" - So how portable is your OS? I think that it's a load of **** to say something like that about asm, how many of you even plan to support more platforms then x86? And even if you do, you will problably never reach that state. Even if you have reach that point it'll be much to do before your OS compiles for another platform.
/ Christoffer
Re: PASCAl or C
Oh, BTW: http://freepascal.org/ could be nice to check out...
Re: PASCAl or C
*NIX-based system, a class of systems, mostly it seemed to split into a lot of different systems after System V UNIX from what I have read. GNU/Linux works like a UNIX system, too, don't forget both have been programmed to be a free implementation of the concept.
What works better for os dev in a unix system:
- gcc and ld work a good deal better
- copying images to floppies is easier
With Eclipse and the CDT you can even have a reasonable GUI!
But I personally don't think these are too good reasons to switch to Linux - once gcc and ld work for you under Windows
What works better for os dev in a unix system:
- gcc and ld work a good deal better
- copying images to floppies is easier
With Eclipse and the CDT you can even have a reasonable GUI!
But I personally don't think these are too good reasons to switch to Linux - once gcc and ld work for you under Windows
*post*
-
trey_monty
- Member

- Posts: 44
- Joined: Thu Mar 10, 2005 12:00 am
Re: PASCAl or C
k. i think i get it. Also why do all of you people not think PASCAL is good for osdev? I run an os(RS3) that was witen in PASCAL.
Re: PASCAl or C
Hey its trey_monty, I changed my user name to ZOSdever
Re: PASCAl or C
Hey if any of yas people have a kernel I can use as my kernel( i hope it is in PASCAL) please say so and ill give ya my email addresess so ya can send it to me.
- carbonBased
- Member

- Posts: 389
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
Re: PASCAl or C
You're assuming it's one or the other -- the alternative to assembly isn't inline assembly.bubach wrote: Come on, what makes you say that "code maintaining herder" ? I think that it's easier then GCC stupid syntax (esp. inline asm) which makes many C hobby OS'es source unreadable.
Granted, any OS will require *some* ammount of assembly, but those of us concerned with portability keep that to a minimum, and, if you're smart, you never use inline assembly because that isn't portable either (I try to use strict ansi c so that I'm not tied to GCC).
This is an anchient battle but, as a proficient asm and C coder, I still fail to see the argument; well written C is more maintainable then well written asm. Asm can certainly be maintainable... and if done really well, it will not be *too* difficult. But that requires quite a lot of extra thought on the asm developer when writting the code, as well.
When one line of C can compile into as many as 20 lines of asm, I find it hard to believe that 20x the source code can be just as easily maintained as the C equivalent -- again, only from the perspective of someone proficient in both. Obviously if you only know asm, C will look strange, and vise versa... but neither are difficult to learn.
That's hardly a reason not to write portable code. Just because the majority of people on this list will never support more then one platform doesn't mean their code shouldn't facilitate it.bubach wrote: "also, if you code your OS in assembly it will not be portable" - So how portable is your OS? I think that it's a load of **** to say something like that about asm, how many of you even plan to support more platforms then x86? And even if you do, you will problably never reach that state. Even if you have reach that point it'll be much to do before your OS compiles for another platform.
The fact of the matter is, to port to a new OS in C, you have to rewrite some files. To port to a new OS in ASM, you have to rewrite everything. This is what C was build for, and it does it well... we all know how many platforms Unix runs on.
Personally, I *do* intend to support multiple platforms, and have recently restructured my entire OS path to reflect this. Because I used mostly C, I'm able to keep my entire mini-libc implementation, and various other parts of the kernel that I've made portably:
queue, expandingQueue, semaphore, mutex, messageQueue, list, much of my multitasking code, runTime object linking, etc, etc, etc.
Truely, their really isn't a whole lot to support a new OS using my current system. As long as you keep that platform dependant interfaces consistent and minimal, you will only ever have to implement these functions (and truely, not even all of them... many of them can be stubbed out for the purpose of getting the OS up and running quickly).
This is something I do for a living -- porting OS layers to various different platforms -- so I at least have some experience and am not speaking blindly. I can also say that I've never encountered an asm OS that was easy to port to a different platform...
Just my views...
Jeff
Re: PASCAl or C
Ok. I try.
Re: PASCAl or C
Just one itty bitty problem: FreePascal, and Pascal in general, along with most variants of C, don't allow accessing the data placed on the stack by the processor when running an interrupt, IE: saved registers.
-
rexlunae
- Member

- Posts: 134
- Joined: Sun Oct 24, 2004 11:00 pm
- Location: North Dakota, where the buffalo roam
Re: PASCAl or C
Well, that's what you need inline assembly for. Although, you can access the data placed on the stack if you do some weird things with C. Function parameters are just stack data, specifically formatted, so you could have an assembly stub call a C function with parameters constructed to coincide with the things the processor put on the stack.Crazed123 wrote:Just one itty bitty problem: FreePascal, and Pascal in general, along with most variants of C, don't allow accessing the data placed on the stack by the processor when running an interrupt, IE: saved registers.
Re: PASCAl or C
OOOOOOOOOOOOOkkkkkkkkkkkkkkkkk. Thanks.
Re: PASCAl or C
For the time being I going to ditch pascal and stick to C.

