Page 1 of 1

Pascal wiki needs correction

Posted: Thu Nov 27, 2008 9:29 pm
by leledumbo
While reading it, I found:
To date no operating system has been written in Delphi
This link says that it's not true.

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 12:32 am
by inflater
What ... the ... :shock: lol I'm jealous - a Win32 application with Win32 DLL's combined to run without a OS. :lol: How he did that? Is he using KERNEL32.DLL to do all dirty work with drivers, filesystems and all? wow. I'm really amazed.

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 3:12 am
by Combuster
the CD is actually bootable and boots into a DOS prompt - not the shell that comes with it. The binaries only run under a real windows so I expect this is just an elaborate joke.

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 3:30 am
by AJ
I agree with combuster. It's years since I programmed in Delphi (Delphi 3, IIRC), but:
ClassiOS Web Site wrote:This was achieved by replacing the System.dcu and related units by a custom unit which can run in Ring 0 of the x86 CPU.
seems very odd. Isn't system.dcu simply a delphified wrapper for the Windows API? I guess you could, in theory, write a kernel in Delphi (just as you can in C#), but you would have to write a lot of support code in asm/c/something else. I think the bit that really gives it away as a joke is:
This operating system is built entirely with the Delphi Compiler - even the boot loader!!
Needless to say, I would love to be proved wrong ;)

Cheers,
Adam

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 7:46 am
by inflater
Hmm, it's weird. Now I got back from the school and experimented with it:
After studying, I extracted the boot contents from the CD image which has 1.44MB fdd emulation. Signature "WinISO" is on the emulation. These files were BOOTLOAD.BIN and CLASSIOS.KXE (which loads SHELL.EXE) and WinImage provided a boot floppy which contained these files, since they aren't visible normally. So I ran Bochs with this "FDD emulation floppy image" which contained just these two files and it asked for SHELL.EXE, so I added it and removed the DLLs on purpose. Kernel fault and it looped infinitely, there was a 32bit register dump . How many DOS'es did you saw lately that created a kernel fault and displayed 32bit registers? #-o

Then I included the DLLs to the "emulation floppy image" and it ran successfully, believe it or not. :shock: I thought they were DOS applications, but they seem to have "This program cannot be run under Win32" message, which outputs the 32-bit delphi compiler (C for Win32 displays "This program cannot be run under DOS mode." under DOS). So I tried to execute both SHELL.EXE and HELLO.EXE under pure DOS and it displayed that message.

Executing the standard SHELL.EXE under Windows environment works normal btw. :!: So I made a test Win32 console application in Delphi that would just display a message, and renamed it to SHELL.EXE. No custom System.dcu, everything standard. I've ran the floppy again with my application and it did a kernel fault and looped.

Conclusion? You decide. I've attached a archive, that contains two floppy images of the "ClassiOS" loader from the CD image. The first - clasios_1 - has the standard shell, the second image has my own test application. Run it, delete the DLLs, or do what you wish and see for yourself.

It doesn't seem to be MS-DOS kernel though - again, SHELL.EXE doesnt work in DOS.

The archive can be downloaded here: http://inflater.wz.cz/osdev/classios.zip

Weird, very weird.

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 1:05 pm
by Laksen
So the disk contains some DOS clone and a 32bit dos extender?

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 1:24 pm
by inflater
I don't know what exactly it contains, but I think it's launching the EXE. BTW weren't DOS extenders used for access above 640K of ram? AFAIK they weren't capable of launching MZ-PE win32 programs...

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 4:34 pm
by Troy Martin
HX DOS Extender has some tools to run Win32 console programs in regular DOS. Pretty neat, actually!

Re: Pascal wiki needs correction

Posted: Fri Nov 28, 2008 5:30 pm
by ru2aqare
Laksen wrote:So the disk contains some DOS clone and a 32bit dos extender?
I've taken a peek inside, and found some dll's, an application and something resembling a kernel. While the dll's seem bogus (in the sense that they don't seem to do anything useful, and were definitely not compiled with Delphi - they miss the usual Delphi stuff, but contain sysenter instructions), the application and the kernel thingy were actually compiled with Delphi (look at the class names). I haven't tested it yet, so I can't comment on whether it actually works, or blows up the second you attempt to run it...