Page 1 of 2

GUI ?

Posted: Sat Oct 21, 2006 11:51 am
by inflater
Hi,
it is been a long time - i decided to resume the work of my OS.

Now, I skip the mouse driver and FAT functions - lets do them later.

I thinked about a GUI - but what is a GUI? Graphical User Interface. I never programmed GUIs before (only TUIs - Text User Interface :D)

Anybody knows a GUI that does not require unit DOS and compiles perfectly under BP 7.0? (640x480x16, for now).

Thanx.

P.S.: The command line in my OS works perfectly.

TO-DO list:
- Make a mouse driver (paused for now)
- Make FAT functions (partial in 0.4 release :D)
- Make user interface (command line is done)

Inflater

Posted: Sat Oct 21, 2006 6:35 pm
by bubach
You can read the GUI tutorial on www.osdever.net and just try to make a simple one, it doesn't have to be perfect the first time, right?

Posted: Sun Oct 22, 2006 1:47 am
by inflater
Yep, it does not have to be complicated (for the first time).

That GUI tutorial is in C++ ... (http://www.osdever.net/tutorials/GUI_tut.php?the_id=62)

Why people limits programming OS's in C++ and JUST ONLY in C or ASM??
Why someone dont uses Pascal for OS dev?

Because "Borland Pascal is 'glued' with DOS" ??? No, it is NOT !
Because Linus Torvalds writed his OS in C ?? And everybody follows him?
"Use Free Pascal for OS dev" - Why? I dont want work in that environment, because i dont want to write 32bit OS. Protected Mode stuff is for me enough - i must "master" real mode first.
"Sorry, but I urge you to make simpler things, not a OS" - S**t up all of you, who says this ! I choosed to make OS and i dont terminate the work, like other people !

(yep, i know that my english is not good, but forget about it)

Yeah, maybe I can translate the C++ code to Pascal - but I am not guru in C++ ...

inflater

Posted: Sun Oct 22, 2006 7:36 am
by Combuster
I'm not a pascal guru, and i am far from familiar with the improvements on that area.

For one, i dont know wether Pascal got object-oriented anywhere (i only have one book on pascal and its dated 1982, like before oop was ever invented). If it isnt, you'll have a rather big problem porting c++ code over.

Since your basic assumptions are fundamentally different from most people. (i.e. 16 bit realmode instead of 32 bit), AND that you are using a different language, you will most likely end up writing your own code. However, you can look at how other GUIs are implemented and see wether theres an approach that suits you.
I suggest you read the tutorials on the matter, thinking over how pascal would do the job, then come again asking if you have problems understanding the underlying principles. (If you have those questions right now, i suggest fire away)

Talking about fundamental differences, one style isnt the other, but please dont assault anybody who thinks different. </attempt to prevent flamewar>

Posted: Sun Oct 22, 2006 10:07 am
by inflater
Pascal (well, Borland Pascal 7.0) is object oriented. I tried to translate SOME SIMPLER code to Pascal and it works (with minor differences, IRQ) so i dont see problems here.

But I see problems here:
C++ structs, typedefs and other stuff are things, that I cannot translate (or with errors). Some translators like C2PAS are buggy. The real problem is, that i cant find (on google, altavista etc) a simple GUIs (in simple graphic mode 640x480) in Pascal. All of them are in C++ OR in Free Pascal style. FP has other 'philosophy' (sry for my English); FP is multi platform and FP uses for DOS a GO32 extender. That is problem for me (CWSDPMI? Dos Protected Mode INterface? My OS is not DOS... and it cant handle files [correctly] yet).
And C++ GUIs uses other interfaces (for example, not BGI drivers) and many tables and structures that are fully opposites of BGI graphic.

I was thinking of building my own GUI - but if it was A LAST RESORT.

inflater

Posted: Sun Oct 22, 2006 10:47 am
by Pype.Clicker
inflater wrote: Because "Borland Pascal is 'glued' with DOS" ??? No, it is NOT !
Because Linus Torvalds writed his OS in C ?? And everybody follows him?
"Use Free Pascal for OS dev" - Why? I dont want work in that environment, because i dont want to write 32bit OS. Protected Mode stuff is for me enough - i must "master" real mode first.
Hey, take a breath, dude..

The fact there is many C/ASM OS around is not just because we all follow Linus. That's just because C has just the ability to toy with the memory the way an OSdever would like to, and that with the language alone (e.g. not relying on a specific compiler/library/whatever).

As for "you don't want 32bit". Fine. For most of us, programming in 16bit sounds like a rather futile exercise, but that's just us. still, that indeed makes less tutorials available.

Posted: Sun Oct 22, 2006 10:50 am
by Dex
First i think its great, that you are choosing your own OS Dev path, and i know how you feel when every example is in C.
I was in the same boat has you when i started many years ago with ASM, then there was very little work done in OS Dev and assembly just the basics.
But now it a bit better (i hope i have help this in a small way).

But the thing you need to remember is not to blame others, if they choose to code in other languages, but work hard and show other example of realmode OS Deving in pascal and then maybe more will join you.

Theres no getting away from it, do it yourself, learn the basic of OS Deving and then code them in pascal, if you can not do this, then your saying that turbo pascal is no good for OS Dev.
The first thing you need to understand is turbo pascal is a realmode Dos compiler, there fore your OS needs to be a Dos clone its as simple as that.
Next your getting you priorities wrong, the last thing on your list is a GUI, but thats up to you, here is a link to a GUI lib for turbo pascal.
http://www.math.uni-magdeburg.de/~mkoep ... kmeng.html

Posted: Sat Oct 28, 2006 1:34 am
by Schol-R-LEA
I realize this may seem like an odd question, but have you ever considered Modula-2? It was Wirth's intended successor for Pascal, and was specifically designed for systems programming. If I am not mistaken, the Amsterdam Compiler Kit, M2M, and FST compilers all support real mode programming (as does the Stony Brook compiler, though that one isn't free; also, I think the Excelsior compiler can be set to generate real-mode code, but I'm not certain). While it isn't Pascal, it is quite similar, and in some ways more robust for this sort of thing. Even if the language doesn't appeal to you, it might be worth a look to see how it solved some of the OS-related problems you might run into using Pascal.

(The Excelsior compiler also supports Oberon-2, which is yet another one of the Pascal family languages. You might want to take a look at that as well, especially since the operating system written in it, also named Oberon, had been ported to the x86 platform and - just to bring us back to the original topic - has a rather interesting GUI of it's own.)

Posted: Sat Oct 28, 2006 1:49 am
by inflater
Modula-2? Isn't that very old? (modula-2: 1984; yep, a RM programming is old, but A.Frounze's mem managment may not work with M2M)... I use BP 7.0 (1993)..

It seems that Pascal OS dev is not very popular... I better write the code myself.

inflater

Posted: Sat Oct 28, 2006 7:59 am
by earlz
well I guess that is one thing that pascal owns C/C++ in the face on.... pascal is much easier to look at and understand then C/C++(without experience in the languages)

you should really try at least getting some simple fat stuff as having your whole gui wrapped in 1 big binary file might cause problems(especially with 64k segments)

Posted: Sat Oct 28, 2006 8:20 am
by inflater
Yes, but I cant find any simple fat stuff (without DOS)... :cry: :cry: :( :cry:

Posted: Sat Oct 28, 2006 8:29 am
by earlz
have you checked anywhere!? their is fat stuff all over http://www.osdev.org/osfaq2/index.php/FAT12%20document that gives a fairly good description over fat12 also you may want to search code.google.com for some pascal stuff

Posted: Sat Oct 28, 2006 5:34 pm
by carbonBased
hckr83 wrote:well I guess that is one thing that pascal owns C/C++ in the face on.... pascal is much easier to look at and understand then C/C++(without experience in the languages)
Debateable, in my opinion. I find pascal and c fairly similar "to look at." Some differences in symbols, but the layout is vertually identical.

I do agree that C code *can* look very nasty... that's as much the fault of the writter of the code, as the C language, though, I think.

--Jeff

Posted: Sat Oct 28, 2006 5:47 pm
by earlz
yea C code can look really bad... just look at the linux 0.0.1 code, they went for the "quick to type" option rather than "readable" option like in a lot of thier code they have functions with just things like "fm" how could anyone know what that means!?

actually I love C though so no one be like "quit bashing C, it can do stuff pascal cant"

Posted: Sat Oct 28, 2006 8:06 pm
by Schol-R-LEA
inflater wrote:Modula-2? Isn't that very old? (modula-2: 1984; yep, a RM programming is old, but A.Frounze's mem managment may not work with M2M)... I use BP 7.0 (1993)..
Depends on what you mean by 'old'. After all, both Pascal and C date back to 1970. Yes, the M2M compiler is rather old, but newer compilers generally aren't going to support real mode programming at all, regardless of the language. The Excelsior compiler is still in current development, but it seems it is Windows only after all; similarly, GNU Modula-2 is going to have the same limitations as any other GCC-based compiler (such as GNU Pascal, the compiler that Dev-Pascal is a front end for; remember GCC isn't so much a single compiler these days as it is a protocol for connecting language specific program analyzers to machine-specific code generators, and most compilers under *nix these days are really just GCC front ends).

[EDIT: Oops, FreePascal isn't based on GNU Pascal, my bad. I must have been thinking of the fact that Dev Pascal can FE for either GNU Pascal or FreePascal.