Archive for the ‘Operating Systems’ Category.

Windows Device Driver in Delphi (Ring 0 Windows programming)

Just recently I thought I’d work on a project I had shelved a few years back. It’s a by-product of the recent Classios work I’ve done. Since I used Delphi (D2006) to build the classios kernel, it seemed logical to see if I could build a windows device driver directly with delphi without the use of C/C++ stubs. It turns out that you can!!

It basically relies on skeleton system.dcu’s etc where the win32 api has been factored out. That combined with some important glue code to make sure that the DeviceMain() function in C is emulated correctly results in a workable .SYS executable. Once that is done, the only thing remaining is to prepare the .SYS file by modifying the win32 PE header slightly so that windows will recognize it as a device driver.

This is a rather powerful way to do kernel mode programming in windows. I’ve been able to build a couple of device drivers so far. The first was a proof of concept. I was able to get the driver to run at ring 0, and then dump the page tables and GDT/IDT. The next useful driver I made was one to directly access the LAN driver. This was able to port some of the code I did for Trumpet Winsock directly to delphi and now have roughly the same functionality as Winpcap.

Delphi now rules the ring 0 world of windows!!

P!

ClassiOS alpha release 0.001

For those patient folks who want to kick the tyres on classios, it’s finally here. Note this is a 0.001 release, just to prove that it exists and boot a kernel. For more details go to the forums http://forums.tattsoft.com/viewtopic.php?t=4.

Continue reading ‘ClassiOS alpha release 0.001’ »

Good things come to those who wait….

Well, it’s finally happened!!!

After more than 5 years, I finally have PetrOS and the other Trumpet products solely in my own name along with the rest of the IP of the Trumpet Software company. This has major implications for the future of PetrOS and ClassiOS. I’m not sure what else to say except it’s been so long, I felt like I was in a straight jacket not being able to code with any great freedom and having to use clean room techniques. Sadly, the reason it has taken so long is that my divorce settlement has taken that long to sort out, the IP being one of the last items to be finally be resolved.

The impact hasn’t fully hit me yet, but I can feel my wings again. Look forward to some new releases.

P!

Update on Classios and embedded work

It’s been a while but it has been moving on slowly. I have got to the stage of running some win32 code finally. I have a small shell (which doesn’t do much yet), but the shell is 100% win32 code (written in Delphi). Basically, I have enough of the win32 api to read/write to the console, read from files, list directory contents and change the current directory. Next on the list will be to fire up another application. I’ve got tcp/ip built into the kernel on this incarnation rather than loading via dll/device driver, so heading down the monolithic kernel path for now which suits embedded type apps.

The beastAlso, of interest, I got myself a small test system (wafer-lx) for embedded work -see pic. It has an AMD LX-800 CPU, 1 gig of ram, and a 4 gig hi speed Flash drive. This little beauty packs quite a punch – more details are below. I’ve got Classios to boot up on it with full TCP/IP networking. I can even boot it via DHCP/TFTP using the PXE protocols. P!

Continue reading ‘Update on Classios and embedded work’ »

Classios – one more step in the evolution of Petros

In the past couple of years, I’ve been tinkering on & off with the new version of PetrOS. This is a total rewrite for a few reasons, but mainly that I was unhappy with the current code base in Petros. The original one was started at a time when Delphi wasn’t around – we’re talking the early 90’s.

What triggered the original development of Petros was the release of the Win32 specification and I felt that this was certainly a step forward in the DOS/Windows PC world. Win3.x was pretty rough as an OS and there was a need to go native instead of on top of DOS. I wanted to do it in pascal, but there wasn’t a 32 bit pascal compiler around at the time so I started writing my own. It was pretty much a spare time project over the years I ran Trumpet and I started with virtually nothing. Also, I’d always wanted to write my own pascal compiler and it didn’t seem too hard a job. Initially I stuck to plain pascal, but it was clear that I would need objects to be at least relevant to the modern world. All said & done, the compiler was a simple one spitting out assembler code, not a full language. Eventually in 2002 I did an amd64 version of the compiler but at that stage I felt it had reached the end of its useful life – it needed a rebuild too. Continue reading ‘Classios – one more step in the evolution of Petros’ »