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.
> 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
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>...
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.
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 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
-----------------------------------------
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>...
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.
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
"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).
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
--------------------------------+------------------------------------
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
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
: 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
AFAIK Borland's object Pascal (TP since 5.5) - is a remake of the Mac's one.
Max
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.
>
Silvo.
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.
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
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
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
____________________________________________________________________________
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
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.
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