Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

An OS in Pascal

21 views
Skip to first unread message

Luis Rafael Medel Cáceres

unread,
Jul 4, 2000, 3:00:00 AM7/4/00
to
Can be Pascal (or Turbo Pascal) used to write an OS?
I don't want speed...I only want to learn :)

bytes256

unread,
Jul 4, 2000, 3:00:00 AM7/4/00
to
In article <39611248$1...@news.arrakis.es>,

"Luis Rafael Medel Cáceres" <me...@arrakis.es> wrote:
> Can be Pascal (or Turbo Pascal) used to write an OS?
> I don't want speed...I only want to learn :)
>
>

I don't see why you can't as long as it supports inline assembly (which
Turbo Pascal does). I recommend learning C though if you want to write
an OS, you definitely have to learn assembly if you don't already know
it.

--
And if you listen very hard
The tune will come to you at last.
When all are one and one is all
To be a rock and not to roll. -Led Zeppelin

Sent via Deja.com http://www.deja.com/
Before you buy.

Gennady Proschaev

unread,
Jul 4, 2000, 3:00:00 AM7/4/00
to
"Luis Rafael Medel CАceres" wrote:

> Can be Pascal (or Turbo Pascal) used to write an OS?
> I don't want speed...I only want to learn :)

Why not?

Gennady Proschaev
http://www.fpos.agava.ru/


Martin Beck

unread,
Jul 4, 2000, 3:00:00 AM7/4/00
to

"Gennady Proschaev" <webm...@fpos.agava.ru> schrieb im Newsbeitrag
news:3961888B...@fpos.agava.ru...

> "Luis Rafael Medel Caceres" wrote:
>
> > Can be Pascal (or Turbo Pascal) used to write an OS?
> > I don't want speed...I only want to learn :)
>
> Why not?
Because Turbo Pascal produces MS-DOS exes? but, however,
the language Pascal can do everything, which one can do in C,
it's just a question, whether your compiler supports producing
binary's, which don't require a specific os...

Martin

Alexei A. Frounze

unread,
Jul 4, 2000, 3:00:00 AM7/4/00
to
Turbo Pascal is an awful choice.

That's because:
- it produces only EXE files
- it depends on run-time library heavily -- especially on the SYSTEM unit
(don't forget about FAR poiters the compiler uses for RTL and other
stuff!!!)

So, I think it's definetely not suitable for PMode OS. And a real mode OS
on top of DOS is a nonsense, I think :)

Good Luck
--
Alexei A. Frounze
-----------------------------------------
E-mail: alexfru [AT] chat [DOT] ru
Homepage: http://alexfru.chat.ru
Mirror: http://members.xoom.com/alexfru
PMode...: http://welcome.to/pmode


Luis Rafael Medel CАceres <me...@arrakis.es> записано в статью
<39611248$1...@news.arrakis.es>...

smile773

unread,
Jul 5, 2000, 3:00:00 AM7/5/00
to
lets say that you want to emulate a system
that has a 64 bit processor with 128 user interupts.
512 MB ram @ 200mhz bus.

lets also say that you want a linux kernel
to take fullest advantage of all the features.

using open source you are aloud to see the code
and the documentation and even add a little knowledge
to someone else about the project however
someone tells you thats impossible.

Are you inclined to wade through the
muck of ancient systemry trying to fix what needs to be
scrapped, or reverse engineer what is obsolete.

Do you want to understand with a goal of moving forward
or just want to wax up the old antique.


Mainframe

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to
In article <39611248$1...@news.arrakis.es>, me...@arrakis.es says...

> Can be Pascal (or Turbo Pascal) used to write an OS?
> I don't want speed...I only want to learn :)

If I was going to use Pascal i'd certainly NOT use Borland.
I would however seriously look at GPC (GNU Pascal) which works
hand in hand with GCC (You'll need djgpp installed to use it),
so it produces 32-bit code and is COFF compatible.

Files you'd need to start are basically:

DJGPP (DOS version of GCC)...
http://www.delorie.com/djgpp

GNU Pascal compiler
http://www.gnu.org/gnulist/production/gpc.html

NASM - Freeware x86 Assembler (You'll need this for bootsector etc)
http://www.web-sites.co.uk/nasm/


Oh yes, i'd also recommend "Rhide" to give you a nice looking
Borland style interface since your used to Turbo Pascal.
That can also be found at
http://www.tu-chemnitz.de/~sho/rho/rhide-1.4/rhide.html

I hope this helps you out.
Dave Smith (New Zealand)


Luis Rafael Medel Cáceres

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to

"Mainframe" <main...@es.co.nz> escribió en el mensaje
news:MPG.13cebfaff...@news.es.co.nz...

thanks! : )
but...what about Free Pascal (FPK)? FPK comes with Blodshed DevPascal IDE
and it's 32 bit too. is a good alternative?

Alexei A. Frounze

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to
> thanks! : )
> but...what about Free Pascal (FPK)? FPK comes with Blodshed DevPascal IDE
> and it's 32 bit too. is a good alternative?

I think FPC is not good for that as well. That's because it depends on RTL
almost the same way as TP/BP does.

Better switch to C and Asm.

Good Luck
--
Alexei A. Frounze
-----------------------------------------

Tobias Skytte

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to
I think FPK would be just fine. I don't see what the problem with RTL is,
just rewrite the system unit and other RTL units you might need. A similar
thing has do be done when using C (the clib) right?


Regards, Tobias Skytte
marksman...@adr.dk (rem. SPAMSUCKS)
"Assumption is the mother of all fuckups" -- unknown
Alexei A. Frounze wrote in message <8k2h7u$14g7$2...@gavrilo.mtu.ru>...

Ivan Wootton

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to

Luis Rafael Medel Cáceres <me...@arrakis.es> wrote in message
news:39649...@news.arrakis.es...

>
> "Mainframe" <main...@es.co.nz> escribió en el mensaje
> news:MPG.13cebfaff...@news.es.co.nz...
> > In article <39611248$1...@news.arrakis.es>, me...@arrakis.es says...
> > > Can be Pascal (or Turbo Pascal) used to write an OS?
> > > I don't want speed...I only want to learn :)
> >
> > If I was going to use Pascal i'd certainly NOT use Borland.
> > I would however seriously look at GPC (GNU Pascal) which works
> > hand in hand with GCC (You'll need djgpp installed to use it),
> > so it produces 32-bit code and is COFF compatible.
> >
> > Files you'd need to start are basically:
> >
> > DJGPP (DOS version of GCC)...
> > http://www.delorie.com/djgpp
> >
> > GNU Pascal compiler
> > http://www.gnu.org/gnulist/production/gpc.html
> >
> > NASM - Freeware x86 Assembler (You'll need this for bootsector etc)
> > http://www.web-sites.co.uk/nasm/
> >
> >
> > Oh yes, i'd also recommend "Rhide" to give you a nice looking
> > Borland style interface since your used to Turbo Pascal.
> > That can also be found at
> > http://www.tu-chemnitz.de/~sho/rho/rhide-1.4/rhide.html
> >
> > I hope this helps you out.
> > Dave Smith (New Zealand)
> >
>
> thanks! : )
> but...what about Free Pascal (FPK)? FPK comes with Blodshed DevPascal IDE
> and it's 32 bit too. is a good alternative?
>
>

I cant believe I'm even bothering to type this out, but hey i'm bored

if one is serious about os development, why would one bother to try and do
it in pascal
if one is serious about learning about os development, then one would
already know about C or its counterpart C++, the idea of prgramming in
pascal is very stupid for any application, why programm in a language which
is handicapped???? I truly seriously hope you learn the C syntax. Hey,
its not much differnent from pascal anyways.

Mainframe

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
> I cant believe I'm even bothering to type this out, but hey i'm bored
>
> if one is serious about os development, why would one bother to try and do
> it in pascal
> if one is serious about learning about os development, then one would
> already know about C or its counterpart C++, the idea of prgramming in
> pascal is very stupid for any application, why programm in a language which
> is handicapped???? I truly seriously hope you learn the C syntax. Hey,

Actually, I beg to differ.. there has been a very good GUI OS developed
completly in Pascal supporting threads etc... It was posted on this
newsgroup a few months ago.. maybe someone still has a link to it??

If you merged GPC with NASM you could code some serious Apps.
I made the transition from Pascal over to C/C++ about 4 years ago, but
hey, even now I sometimes use Pascal for some projects because of it's
ease of use.

Cheers
Dave

Konrad Schwarz

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to

"Luis Rafael Medel Cáceres" schrieb:


>
> Can be Pascal (or Turbo Pascal) used to write an OS?
> I don't want speed...I only want to learn :)

Apollo Domain (or whatever it was called) was written in Pascal.
Apollo Computer made one of the first workstations and was one
of SUNs early competitors (had a larger market share too).

(null)

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
In article <3965B19F...@mchp.siemens.de>,

Konrad Schwarz <konrad....@mchp.siemens.de> wrote:
>
>Apollo Domain (or whatever it was called) was written in Pascal.
>Apollo Computer made one of the first workstations and was one
>of SUNs early competitors (had a larger market share too).


I still have fond memories of those machines.

Writing programs for them in Pascal was a pleasure, with C you'd
occasionally notice that C was not a first class citizen. I guess
that's kind of the opposite from Unix where using anything but C
involves a contortion from time to time.

I've noticed that an operating system's API reflects the underlying
implementation language. That's why I find the Win32 API kind of
is kind of surprising. Since it was originally (at least with
version 1.x) written in Pascal I'm surprised that the current API's
don't reflect a more Pascalish view of the world.


--
=======================================================================
Life is short. | Craig Spannring
Bike hard, ski fast. | c...@internetcds.com
--------------------------------+------------------------------------

Tobias Skytte

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
>
>I cant believe I'm even bothering to type this out, but hey i'm bored

me too :-)

>
>if one is serious about os development, why would one bother to try and do
>it in pascal
>if one is serious about learning about os development, then one would
>already know about C or its counterpart C++, the idea of prgramming in
>pascal is very stupid for any application, why programm in a language which
>is handicapped???? I truly seriously hope you learn the C syntax. Hey,

>its not much differnent from pascal anyways.
>


I'm serious about OS devellopment and I intend to use FPK (Free Pascal). IMO
it seems like quite a competent compiler.
The language isn't handicapped. Your statement is subjective.
I don't think language matters much. Most use C some use Assembler some use
Pascal some us other exotic things. IMHO it's the layout and the
functionality that counts in an OS, not so much in which language it was
implemented. AFAIK Windows was made in C and it *sucks*.......

regards,
Tobias


Greg Law

unread,
Jul 10, 2000, 3:00:00 AM7/10/00
to
"(null)" wrote:
[...]

> I've noticed that an operating system's API reflects the underlying
> implementation language. That's why I find the Win32 API kind of
> is kind of surprising. Since it was originally (at least with
> version 1.x) written in Pascal

are you sure? I was under the impression it was always C or assembler.
I'm quite prepared to be wrong on this, but I thought win95 is mostly
assembler, and NT pretty much all C.


Greg

--
Greg Law, email: g...@soi.city.ac.uk
Dept. Of Computing, web: http://www.soi.city.ac.uk/~gel/
City University, phone: +44 20 7477 8341
London, UK. EC1V 0HB. fax: +44 20 7477 8587

John Jensen

unread,
Jul 15, 2000, 3:00:00 AM7/15/00
to
Greg Law <g...@soi.city.ac.uk> writes:

: "(null)" wrote:
: [...]
: > I've noticed that an operating system's API reflects the underlying
: > implementation language. That's why I find the Win32 API kind of
: > is kind of surprising. Since it was originally (at least with
: > version 1.x) written in Pascal

: are you sure? I was under the impression it was always C or assembler.
: I'm quite prepared to be wrong on this, but I thought win95 is mostly
: assembler, and NT pretty much all C.

Pascal was quite a popular microcomputer language in the early '80s. I
used it to develop real-time medical instruments. C was considered
"unsafe" by some, while Pascal was considered "too limited" by others. I
think the problem was that strict Jensen (no relation) and Wirth Pascal
was a little too restrictive for industrial use. We took the backdoor,
through proprietary extensions to Pascal, and an escape to assembly
subroutines when that failed. We would sometimes code an assembly
"converson" routine that was simply a "return" to beat the Pascal type
checking.

My opinion was that a good extended Pascal could do what C could do ...
but unforunately everybody's Pascal extensions were different.

I'm not srue about the early Win, but I think the Mac was coded in
Classical(?) an early object Pascal. I wouldn't be surprised if many
microcomputer OS projects were using Pascal variants in this timeframe.

John

Maxim S. Shatskih

unread,
Jul 16, 2000, 3:00:00 AM7/16/00
to
> I'm not srue about the early Win, but I think the Mac was coded in
> Classical(?) an early object Pascal. I wouldn't be surprised if many

AFAIK Borland's object Pascal (TP since 5.5) - is a remake of the Mac's one.

Max

Diego Sáenz Mártinez

unread,
Jul 22, 2000, 3:00:00 AM7/22/00
to
I think first versions of windows was pascal. In C includes the calls have PASCAL
word to push parameters in stack in pascal order. About NT it is not derive
original windows source and was wrote in C++.

excusme for my bad english.

Greg Law escribió:

> "(null)" wrote:
> [...]
> > I've noticed that an operating system's API reflects the underlying
> > implementation language. That's why I find the Win32 API kind of
> > is kind of surprising. Since it was originally (at least with
> > version 1.x) written in Pascal
>
> are you sure? I was under the impression it was always C or assembler.
> I'm quite prepared to be wrong on this, but I thought win95 is mostly
> assembler, and NT pretty much all C.
>

Thomas Volkert "Silvo"

unread,
Jul 23, 2000, 3:00:00 AM7/23/00
to
Oh no, MS mostly uses C (and Assembler) [ok, ok, a little bit of Basic
for Office.. :-) .... ]. NO PASCAL!

Silvo.


Jerry Coffin

unread,
Jul 23, 2000, 3:00:00 AM7/23/00
to
In article <397A05DD...@wanadoo.es>, die...@wanadoo.es says...

> I think first versions of windows was pascal. In C includes the calls have PASCAL
> word to push parameters in stack in pascal order. About NT it is not derive
> original windows source and was wrote in C++.

At least according to most available sources, the majority of NT was
written in C. A few things like the graphics subsystem were written
in C++, but from the looks of things even those make relatively
limited use of C++ features.

--
Later,
Jerry.

The universe is a figment of its own imagination.

Maxim S. Shatskih

unread,
Jul 26, 2000, 3:00:00 AM7/26/00
to
> word to push parameters in stack in pascal order. About NT it is not
derive
> original windows source and was wrote in C++.

No.
- NT kernel + the majority of drivers and FSs - just C with MS extensions
(like try/catch).
- the graphics engine - C++ (rewritten from scratch).
- the window manager - just C (ported from Win3.1)
- base user-mode DLLs - just C.
- OLE/COM - C++
- RPC - C and C++

Max

Maxim S. Shatskih

unread,
Jul 26, 2000, 3:00:00 AM7/26/00
to
> written in C. A few things like the graphics subsystem were written
> in C++, but from the looks of things even those make relatively

I've heard that NT GRE was the _very first_ MS's code written in C++ - they
did not have a C++ compiler at that time of 90-91-92 (?), so... they used
cfront :-)

Max

Pieter Dumon

unread,
Jul 27, 2000, 3:00:00 AM7/27/00
to
Windows has always been written in C. It's just MS programmers never got
the hang of functions with a variable number of parameters, like printf,
so they use the PASCAL calling method
:-))

Pieter


Diego =?iso-8859-1?Q?S=E1enz=20M=E1rtinez?= (die...@wanadoo.es) wrote:
: I think first versions of windows was pascal. In C includes the calls have PASCAL
: word to push parameters in stack in pascal order. About NT it is not derive


: original windows source and was wrote in C++.

: excusme for my bad english.

: > [...]


: > > I've noticed that an operating system's API reflects the underlying
: > > implementation language. That's why I find the Win32 API kind of
: > > is kind of surprising. Since it was originally (at least with
: > > version 1.x) written in Pascal

____________________________________________________________________________

Pieter Dumon

Pieter...@rug.ac.be Pieter...@vtk.rug.ac.be
http://studwww.rug.ac.be/~pdumon http://www.vtk.rug.ac.be
____________________________________________________________________________

Maxim S. Shatskih

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to
> Windows has always been written in C. It's just MS programmers never got
> the hang of functions with a variable number of parameters, like printf,
> so they use the PASCAL calling method

It leads to smaller code size - RET n is used in the function body, instead
of ADD SP, n _after each call_ - which can be plenty.
Win32 and NT kernel also uses __stdcall calling convention by default -
which is renamed PASCAL.

Max

Jerry Coffin

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to
In article <8m4872$kqr$1...@gavrilo.mtu.ru>, ma...@storagecraft.com
says...

No, __stcall is not the same as Pascal calling convention. First of
all, Pascal normally implies that names are in all caps with no extra
decoration. Second, __stdcall pushes arguments from right to left
while Pascal pushes arguments from left to right.

As far as the call code itself goes, __stdcall is the same as __cdecl
except that the callee clears the stack. As far as naming goes,
__stdcall also normally implies adding "@nn" to the end of the name,
with nn=number of bytes of arguments expected by the function.

Maxim S. Shatskih

unread,
Aug 1, 2000, 3:00:00 AM8/1/00
to
> No, __stcall is not the same as Pascal calling convention. First of

You're right - but it is a fact that PASCAL is defined as __stdcall in
Win32.
That's why I made a mistake in declaring that it is the same.

Max

0 new messages