Page 2 of 4

Posted: Tue Oct 24, 2006 9:54 am
by Brynet-Inc
Here are the native Win32 builds:
http://www.gnu-pascal.de/binary/mingw32/
http://www.gnu-pascal.de/binary/msys/

It's not very hard to see.. :roll:

Here is a Cygwin version: http://www.gnu-pascal.de/binary/cygwin/

:wink:

From the site, Apparently it's a Free 32/64-bit Pascal Compiler!

Posted: Tue Oct 24, 2006 9:59 am
by inflater
"You need to download and install the full Mingw release"
This is unacceptable and sick. Again - you must download THIS and THIS and make THIS. Forget, please, about GP; PLEASE.

Win32 (that Mingw) target cannot be used to build OS.
And again, i am making 16-bit real mode OS, not 32bit or 64bit, just 16bit.

I need ONLY, and ONLY, and absolutely ONLY THE SOURCE code[[/u of add_irq function, EVEN IN C, but please, REAL MODE.

Please FORGET about that GP. I am getting sick of it. I started dev for my OS in BP and merging to GP will cause ONLY COMPLICATES.

inflater

Posted: Tue Oct 24, 2006 10:04 am
by Brynet-Inc
:roll: Being mean is not nice..

Posted: Tue Oct 24, 2006 10:09 am
by gaf
I need ONLY, and ONLY, and absolutely ONLY THE SOURCE code of add_irq function, EVEN IN C, but please, REAL MODE.
You do realize that add_irq() and SetIntVec() are the same thing ?

regards,
gaf

Posted: Tue Oct 24, 2006 10:13 am
by inflater
Sorry for being mean but how do you expect with this?
Read this:

1.You started a work for OS dev in Borland Pascal. It is a 16 bit OS.
2.Then, you must someone ask for help, and you will be NICE, and that guy will answer. Apparently good.
3.But that examples (or tutorials) does not work and is in other programming language that you are having.
4.OK, you will find other. But - a OS dev is strictly glued with C. Your nerves are strangling, because on Net is no such thing as a tutorial for pascal.
5.Then, you will NICE ask again. And then someone says: "Try use this and this", but you have a project in progress and you dont want to interrupt it.
6.And here we go; download links; some tutorials by a amateur and a "Use this better and good thing ! download here: blah blah"
7.You are getting sick of it, arent you? And here we go again; like a broken record. And someone saids this: "Have you tried this? And this? There is blah blah, and it is a 32 BIT, for Win32 (MingW) No problem !".
8.You know how you feel, dont you ??? !!! :evil: :evil:

And that is EXACTLY ME !
inflater

Posted: Tue Oct 24, 2006 10:25 am
by Brendan
Hi,
inflater wrote:But, I dont want to download GP, because of... for example: CRT unit. There is nothing better than a patched unit from Pedt Scragg (RE 200) and not a other unit... The GP unit may not have functions like Sound, Window and so on.
Do you honestly think any of those things (sound, video, file I/O, etc) will work without DOS/Windows running in the background? It's not like you're writing an application - normally for high level languages you need to rewrite most of the libraries yourself to suit the OS....
inflater wrote:I need ONLY, and ONLY, and absolutely ONLY THE SOURCE code[[/u of add_irq function, EVEN IN C, but please, REAL MODE.


Forgive me if I'm wrong, but didn't you already have the code for this?

Code: Select all

Procedure SetIntVec(Vec:integer;VAddr:pointer);
begin
pointer(meml[0:vec*4]) := vaddr;
end; 
Of course I'm still wondering if your compiler will do this as an atomic 32-bit write. If it doesn't (or if you're unsure and don't know how to check), you will need to disable interrupts before setting the interrupt vector and then enable them again after setting the interrupt vector to prevent your code from crashing occasionally.

To disable and enable interrupts you need to use assembly (CLI and STI instructions). I've been programming assembly for over 10 years, but unfortunately I can't help with this because I don't know how your compiler (or pascal in general) supports inline assembly. I could show you for GCC and I'd be very surprised if GPC was different, but...
inflater wrote:7.You are getting sick of it, arent you? And here we go again; like a broken record. And someone saids this: "Have you tried this? And this? There is blah blah, and it is a 32 BIT, for Win32 (MingW) No problem !".
8.You know how you feel, dont you ??? !!! :evil: :evil:
Look at it like this - if you went to a professional builder and said "I want to build a sky-scraper out of cotton wool balls, but I need help with the second and third cotton wool ball, can you help?", then what would you expect the builder to say? If he's a really mean builder, he might (really politely) explain how to glue the cotton wool balls together and then laugh at you while you're wasting years trying to build a sky-scraper that blows away when there's a light breeze. If he's a very kind builder, then perhaps he'd suggest using concrete. If several builders all said "use concrete instead", would you get annoyed at the builders?

[EDIT} Please don't take this the wrong way - there are good reasons for using real mode, like a desire to support DOS or CP/M applications, making an OS that works on old 8086/80186/80286 machines, or only writing it as an easy way to mess with the hardware (testing theories, etc before applying them elsewhere).[/EDIT]


Cheers,

Brendan

Posted: Tue Oct 24, 2006 10:30 am
by Brynet-Inc
@Brendan, Well said.. Well said indeed 8)

Posted: Tue Oct 24, 2006 10:32 am
by inflater
If you dont know, the CRT unit transforms EVERY commands like writeln and ALL her functions to BIOS. I tested it. So i do not need to make any external functions.
Forgive me if I'm wrong, but didn't you already have the code for this?
Well, maybe yes. It is a simple 'explosion' in your brain, when you have it too much. Not just OS dev.

Again, I am not programming 32 bit and BP is surely not 32bit. Why I am not using 32bit? I choosed pascal, classic pascal and not any derivates or clones. And that 32bit will be sooo complicated, dont you know? I dont know how to imagine that situation, when my OS, programmed in 16 bit and uses all BIOS functions, to work perfectly (forgive my English).

I must completely learn real mode, then protected. And in protected I could say "Good bye, (Borland) Pascal" and switch to ASM - a nightmare, a hell for ... you know what.

inflater

Posted: Tue Oct 24, 2006 10:45 am
by Dex
Right first you want your OS to be realmode, OK, also you want to write a turbo pascal OK, we got that, but you are going to come up with big problem.
One is that most people will not be able to help you with it as they use pmode.
Some of the stuff you are mixing up realmode OS coding and pmode coding.
Most of the tut are written with pmode OS in mind, so bear this in mind.

Right so you want mouse support in your OS, you need to break the problem down in to small problems, heres a simple mouse functions for pascal with DOS and a MOUSE drive installed

Code: Select all

  uses Crt, Dos;
 {**********************************************}
  Procedure ResetMouse;
   var regs : registers;
   Begin
     FillChar (regs, SizeOf(regs), 0);
     regs.ax := $0000;
     Intr ($33, regs);
    if regs.ax <> $FFFF then begin
       writeln ('hardware/driver not installed');
       halt;
    end;
   end; (* ResetMouse *)
 {**********************************************}
  Procedure ShowMouseCursor;
   var regs : registers;
   begin
     FillChar (regs, SizeOf(regs), 0);
     regs.ax := $0001;
     Intr ($33, regs);
  end; (* ShowMouseCursor *)
 {**********************************************}
 procedure HideMouseCursor;
   var regs : registers;
    begin
     FillChar (regs, SizeOf(regs), 0);
     regs.ax := $0002;
     Intr ($33, regs);
    end; (* HideMouseCursor *)
 {**********************************************}
  Procedure GetMouseCursor (var row, column, button : word);
   var Regs : Registers;
   Begin
     FillChar (Regs, SizeOf(Regs), 0);
     Regs.ax := $0003;
     Intr ($33, Regs);
     Row    := Regs.dx Div 8;
     Column := Regs.cx Div 8;
     Button := Regs.bx;
   End; (* GetMouseCursor *)
 {**********************************************}
  Procedure PutMouseCursor (Row, Column : word);
    var Regs : Registers;
    Begin
       FillChar (Regs, SizeOf(Regs), 0);
       Regs.ax := $0004;
       Regs.dx := 8 * row;
       Regs.cx := 8 * column;
       Intr ($33, regs);
    End; (* PutMouseCursor *)
 {**********************************************}
 procedure TEST;
   var Row, Col, But : word;
   begin
   Clrscr;
     repeat
       GotoXY(1,1);
       GetMouseCursor (Row, Col, But);
       TextColor(LightRed+Blink);
       write (' row=', row:4, ', col=', col:4, ', but=', but:2);
     until KeyPressed;
   end;
 {**********************************************}
   Begin
     ResetMouse;
     ShowMouseCursor;
     PutMouseCursor (12, 39);
     TEST;
     HideMouseCursor;
   end.
Now every where that this bit of code is "$33, regs" means you can not use it, so what you need to do is write a mouse driver that you can set with the setvect function to point to your driver when int 33h is called.

Now i started OS coding by wanting to code a pascal OS, the problem is you need to also know asm as well , So I learnt ASM, but my OS ended up 90% asm with very little pascal, so i thought i may as well code 100% ASM and that s what i did.

I could code you a pascal mouse driver with no dos uses, but it would not teach you anything.

Posted: Tue Oct 24, 2006 11:08 am
by inflater
This can I understand (if there is something like EAX or something - pmode, or USE32 - pmode too :wink:)

I can call real interrupts (i am not that stupid :D and i know, that INT 33h belongs without DOS mouse driver to IRET), and with your help, Dex, maybe handling IRQs... read next :D

I have something messed up in my code and mouse and keyboard totally stopped working in qemu and bochs (AARGH)... so... i must find that problem...

The problem is:
When trying to write text on console, it works fine, but when i try to read from keyboard (all BIOS ints), it freezes.

If you all want, there is posted POS_INT.PAS - ALL interrupt handling in my OS - to know my interrupt handling, for example, mouse driver :D :D but get ready for real shock now :D :D

here it is:
http://inflater.ic.cz/POS_INT.PAS

inflater

Posted: Tue Oct 24, 2006 11:15 am
by Brynet-Inc
inflater wrote:....I choosed pascal, classic pascal and not any derivates or clones....
inflater
Pascal was designed in 1970, Your not using Classic pascal..

Borland Pascal is a derivative, Including changes like object orientation and various other additional changes.

Borland Pascal itself is a dialect of Pascal.. So why is an old dialect better then a new one? GPC.

Your going to notice a majority of the users here use languages like Assembly,C and C++ for OS Development.

Good luck finding a Pascal OSDev Forum 8)

(Information obtained from http://en.wikipedia.org/wiki/Pascal_%28 ... anguage%29)

Posted: Tue Oct 24, 2006 11:21 am
by inflater
[EDIT} This post was deleted by Brendan, as it was deemed "less than constructive"... [/EDIT]

Posted: Tue Oct 24, 2006 11:24 am
by Brynet-Inc
Now that was rude and uncalled for :cry:

I was only stating facts..

Posted: Tue Oct 24, 2006 11:27 am
by inflater
Why you cornhole all, who wants to find help here and with other specifications? Why ??
If you are making smart, go make an OS in GPC then...

I thinked you have some heplful hints for beginers, amateurs, and everybody, who searches information. You think a hassle about other programming language will work ?

inflater

Posted: Tue Oct 24, 2006 11:36 am
by Brynet-Inc
No Thanks, I'll stick with C and GCC ;)

Good luck with your project 8)