Jump to content


Photo

Is Anyone Seriously Trying To Get A Full Windows Kernel Running?


  • Please log in to reply
102 replies to this topic

#16 nt authority

nt authority

    X-S Enthusiast

  • Members
  • 10 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 16 March 2006 - 09:22 AM



Thanks for your answer Torne.

Again, I wish to remind you I do not claim to have any expertise in this field whatsoever and you are probably right by stating I do not have the exact expertise, at the moment, to build a customised windows for the xbox. I am however very determined to learn and will continue. My understanding of what needs to be done is as follows and im sure you will correct me if I am wrong:

Assuming we wish to boot into Windows Preinstallation 2003 from the OPK (because of the minimal driver set and fixed registry):

Such could be done if:

1) a DEFAULT.XBE boot loader was created.

2) a modified xbox-friendly NTOSKRNL.EXE was created to replace that on the WINPE OPK ISO.

3) a modified xbox-friendly HAL.DLL was created to replace that on the WINPE OPK ISO.

As such I am sitting here thinking it can not be that hard to modify the Windows Source Code, providing you were allowed to legally use such, in order to build xbox friendly versions. The code in \ntos\init\ could be modified for the xbox and used in conjunction with the xbox hal code developed by the team at Reactos.org and on top of this all those unfriendly hardware things in \ntos\boot\ could be removed so that the system operates.

Is this not a proper view of what needs to be done ?

BTW I am looking into kexec for Linux to see if I do reach such enlightenment.


#17 torne

torne

    X-S Expert

  • Members
  • PipPipPip
  • 684 posts
  • Location:London, UK
  • Interests:Reverse engineering, Linux, crazy operating systems voodoo, embedded development
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 16 March 2006 - 11:44 AM

QUOTE(nt authority @ Mar 16 2006, 08:29 AM) View Post

Assuming we wish to boot into Windows Preinstallation 2003 from the OPK (because of the minimal driver set and fixed registry):

Doesn't make much difference; you only need to load boot device drivers anyway (some kind of console, some kind of debug port, some kind of storage device, and that's about it) and the registry is always fixed for any given boot wink.gif

QUOTE

As such I am sitting here thinking it can not be that hard to modify the Windows Source Code, providing you were allowed to legally use such, in order to build xbox friendly versions. The code in \ntos\init\ could be modified for the xbox and used in conjunction with the xbox hal code developed by the team at Reactos.org and on top of this all those unfriendly hardware things in \ntos\boot\ could be removed so that the system operates.

Is this not a proper view of what needs to be done ?

You won't know until you try. What needs to be done will depend on what you've, err, done. Write some stuff, watch it crash, repeat. You are thinking it cannot be that hard; think differently, it will be hard.

But, posting the same questions isn't going to get you anywhere. Go do it, if you think you can, and get back to us when you've made progress.

#18 edude03

edude03

    X-S Enthusiast

  • Members
  • 28 posts
  • Location:Brampton, Ontario
  • Xbox Version:v1.6
  • 360 version:v1 (xenon)

Posted 04 April 2006 - 05:07 PM

Here's My (somewhat stupid Probably) Idea.
Well, we have the source code for many system enulators,
we have the MS Xbox Bios,
Their is even CXBX, so why don't we try doing all this via emulation.
I don't mean emulate an pc on an xbox (although porting QEMU would be great) I mean emulate an xbox on a PC and try anything we can think of.

Also, What about ReactOS? I know there system isn't complete, but can't we sway some of their libraries with MS binaries? Sure it would probably be illegal but as long as its not distributed (as in everyone would provide there own bins) I do see it being a problem

So in conclusion I say we
Make an xbox emulator based on the MS Bios and a current emulator
Fix some of the problems with the ReactOS HAL and find a way to use MS bins
Port the 'nv' driver to ReactOS
NOt sure what else

Michael

#19 torne

torne

    X-S Expert

  • Members
  • PipPipPip
  • 684 posts
  • Location:London, UK
  • Interests:Reverse engineering, Linux, crazy operating systems voodoo, embedded development
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 06 April 2006 - 04:00 PM

QUOTE(edude03 @ Apr 4 2006, 05:14 PM) View Post

Here's My (somewhat stupid Probably) Idea.
Well, we have the source code for many system enulators,
we have the MS Xbox Bios,
Their is even CXBX, so why don't we try doing all this via emulation.
I don't mean emulate an pc on an xbox (although porting QEMU would be great) I mean emulate an xbox on a PC and try anything we can think of.

It's been looked at before, it's not that trivial. The Xbox's hardware pecularities are not fully understood.
Also, this doesn't gain you a lot - you'd have no way of knowing whether the emulator was 100% compatible with the xbox, so porting Windows to run under the emulator wouldn't give you many guarantees of it actually running on the xbox either.

QUOTE

Also, What about ReactOS? I know there system isn't complete, but can't we sway some of their libraries with MS binaries? Sure it would probably be illegal but as long as its not distributed (as in everyone would provide there own bins) I do see it being a problem

ReactOS on the Xbox is a more likely port due to availability of source code. Nobody seems to be interested, though. Using parts of ReactOS with parts of Windows doesn't really work that way - ReactOS is intended to be compatible with the Windows userspace, but the kernel side is rather different - you can't load Windows drivers on ROS, and you certainly couldn't use a HAL from one and kernel from the other, or anything like that - that just isn't what the ROS project is for.

QUOTE

So in conclusion I say we
Make an xbox emulator based on the MS Bios and a current emulator
Fix some of the problems with the ReactOS HAL and find a way to use MS bins
Port the 'nv' driver to ReactOS
NOt sure what else

It's not neccecary to make it that complicated, really. Either port ReactOS and forget about MS Windows altogether, or do the hacks I have outlined in this thread to get a native Windows kernel running.

Incidentally, the differences between the Xbox and a regular PC are much less than the differences between an Intel-based Mac and a regular PC - but both the xponmac team, and Apple themselves, have managed to get XP to boot on the Intel Macs. A similar approach to xom for the Xbox would actually be quite interesting; it wouldn't be *completely* impossible to write an Xbox executable that could function as a simulacrum of a PC real-mode bios (though this would have to be a freestanding executable that ran as if it were a BIOS and accessed the hardware directly, because it's not viable to call the Xbox's kernel services from real mode). That would get you quite far with booting NT.. though it's a toss-up as to whether that'd be more or less work than just hacking up the NTLDR boot process as I already described. (PC BIOSes are hard, mmkay).

#20 Trav41514

Trav41514

    X-S Enthusiast

  • Members
  • 5 posts
  • Location:Australia
  • Interests:Programming, Games, Hacking devices.
  • Xbox Version:v1.1
  • 360 version:none

Posted 25 June 2006 - 09:19 AM

why start hard, i'm starting a project on porting dos to the xbox, anyone interested?

Website:
www.sourceforge.net/project/xdos

#21 torne

torne

    X-S Expert

  • Members
  • PipPipPip
  • 684 posts
  • Location:London, UK
  • Interests:Reverse engineering, Linux, crazy operating systems voodoo, embedded development
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 25 June 2006 - 03:30 PM

Porting DOS would be harder, not easier. Getting real mode on the Xbox to look anything like real mode on a PC is basically impossible and anything that uses direct hardware access instead of DOS/BIOS interrupt services will not work. Porting a modern protected mode OS is much simpler.

#22 Trav41514

Trav41514

    X-S Enthusiast

  • Members
  • 5 posts
  • Location:Australia
  • Interests:Programming, Games, Hacking devices.
  • Xbox Version:v1.1
  • 360 version:none

Posted 25 June 2006 - 11:29 PM

QUOTE

Porting DOS would be harder, not easier. Getting real mode on the Xbox to look anything like real mode on a PC is basically impossible and anything that uses direct hardware access instead of DOS/BIOS interrupt services will not work. Porting a modern protected mode OS is much simpler.


People said the same thing about windows but now there's the .net version, and the same for linux.

anyway, i don't believe the xbox has a hard-ware clock, anyone know?


#23 Trav41514

Trav41514

    X-S Enthusiast

  • Members
  • 5 posts
  • Location:Australia
  • Interests:Programming, Games, Hacking devices.
  • Xbox Version:v1.1
  • 360 version:none

Posted 25 June 2006 - 11:54 PM

Wouldn't it be possible to decompile the current WIN CE.NET default.xbe, recompile it to use the NT bootloader which has all the stuff that locks the xbox up removed, then have the bootloader boot file from an image file such as the current WIN CE.NET, or have the NT image file contents on a new partition on the xbox hard-drive?

#24 torne

torne

    X-S Expert

  • Members
  • PipPipPip
  • 684 posts
  • Location:London, UK
  • Interests:Reverse engineering, Linux, crazy operating systems voodoo, embedded development
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 26 June 2006 - 09:56 AM

QUOTE(Trav41514 @ Jun 25 2006, 11:36 PM) View Post

People said the same thing about windows but now there's the .net version, and the same for linux.

CE.NET is an embedded OS, not a PC OS, and the source code was available to do the port. I'm not aware that anybody ever said Linux would be hard to port - it wasn't. wink.gif
You are misunderstanding my point - *real mode* on the xbox doesn't look anything like real mode on a PC. Protected mode is pretty similar. (since everything is PCI and relatively modern) Any protected mode OS at all (Linux, NT-derived Windows, Reactos, QNX, whatever you like) is easy enough to port, subject to being able to make the few required changes (harder for Windows due to the lack of source code).

QUOTE

anyway, i don't believe the xbox has a hard-ware clock, anyone know?

It does have a hardware clock, but I don't recall offhand whether it's available via the usual PC-compatible RTC mechanism. Many of the ISA IO port services that are normally present on a PC aren't available on the Xbox.


QUOTE(Trav41514 @ Jun 26 2006, 12:01 AM) View Post

Wouldn't it be possible to decompile the current WIN CE.NET default.xbe, recompile it to use the NT bootloader which has all the stuff that locks the xbox up removed, then have the bootloader boot file from an image file such as the current WIN CE.NET, or have the NT image file contents on a new partition on the xbox hard-drive?

...the NT bootloader can't load CE, because CE is not an NT-derived OS. Nobody has managed to create a copy of NTLDR that will work on the xbox anyway, since hacking the binaries to make them run is tricky. I have no idea what you are trying to achieve by this. If you don't understand the difference between an embedded OS with source available that already runs on dozens of hardware platforms including many non-x86 platforms (CE) and a regular desktop OS with no current non-PC support and no source code (NT) then you should probably do some more reading on the topic first.

#25 m0dul4rX 2

m0dul4rX 2

    X-S Enthusiast

  • Members
  • 25 posts
  • Location:Lombard, Illinois, USA
  • Interests:Old arcade systems, strange music (Apocalyptica, Mark Boals, Dimmu Borgir, etc...), XBox modding.
  • Xbox Version:v1.0
  • 360 version:none

Posted 26 June 2006 - 10:48 AM

You know, technically Windows is already on Xbox. The Xbox kernel is just a mutated form of the Win2000 kernel, or so I am told. If the w2k kernel is already on the box, why don't you just take that code and splice it with Win2k?

And for legality's sake, copy the entire kernel by hand via Hex Editor so you can say that you "built" it. And then just use the video and sound drivers provided with the stock xbox. That just may work.

Or, try this...

Has anyone taken a regular PC bios, modify it for use on an xbox, and then flash it to a chip? That may work... Granted that it has to be modified to work with Xbox, but xbox is essentially a pc so that shouldn't be hard...


If I were a coder, I'd do it in a heartbeat...

Let's just stick with Linux...
BTW, has anyone tried the linux distro Xandros? Should be like a Windows/Linux bastard child of some sort with Linux stabilty and support for Windows apps...

The open-circulation version is free and can be downloaded via bittorrent , I forget the site, google it and see...


#26 torne

torne

    X-S Expert

  • Members
  • PipPipPip
  • 684 posts
  • Location:London, UK
  • Interests:Reverse engineering, Linux, crazy operating systems voodoo, embedded development
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 28 June 2006 - 12:17 PM

QUOTE(m0dul4rX 2 @ Jun 26 2006, 10:55 AM) View Post

You know, technically Windows is already on Xbox. The Xbox kernel is just a mutated form of the Win2000 kernel, or so I am told. If the w2k kernel is already on the box, why don't you just take that code and splice it with Win2k?

Because the kernel on the Xbox has most of its functionality removed. It's descended from the NT kernel but is no longer compatible in any meaningful sense. It would be easier to modify an NT kernel from scratch to support the Xbox, since the changes required are not huge (just hard to work out exactly what to change).

QUOTE

And for legality's sake, copy the entire kernel by hand via Hex Editor so you can say that you "built" it. And then just use the video and sound drivers provided with the stock xbox. That just may work.

...copying the code from MS's kernel is copyright violation, however you do it. You could read the data over the phone to someone else to type in and that would still be copyright violation. Legality is not a problem for the port - if someone patches an NT kernel, the patch could be distributed perfectly legally and then people could apply it to a copy of Windows they legally own themselves.

The drivers would be difficult to extract from the kernel since they have been assembled into a monolithic whole. Not impossible, but again, for legal and practical reasons it would be easier to write new drivers.

QUOTE

Has anyone taken a regular PC bios, modify it for use on an xbox, and then flash it to a chip? That may work... Granted that it has to be modified to work with Xbox, but xbox is essentially a pc so that shouldn't be hard...
If I were a coder, I'd do it in a heartbeat...

If you were a coder you'd recognise that what you are talking about is irrelevant and also impractial smile.gif
Windows does not depend on BIOS services once it's progressed past the early stages of NTLDR, so implementing a PC-compatible BIOS for the Xbox would be of no practical use. Replacing NTLDR with a custom loader intended for the Xbox (like Cromwell is for Xbox-Linux) would be far less effort.

There's not much use for a PC-compatible BIOS on the Xbox for any other purpose either; few things that bother to use BIOS services don't also access the hardware directly for some purposes. Even DOS doesn't entirely keep its hands off the hardware - it uses BIOS services but also implements new services of its own. Things then fall down because the old-school ISA hardware that's expected to be present by those old OSes is absent, or different, on the Xbox.

QUOTE

Let's just stick with Linux...

Indeed smile.gif

QUOTE

BTW, has anyone tried the linux distro Xandros? Should be like a Windows/Linux bastard child of some sort with Linux stabilty and support for Windows apps...

Xandros is not a 'bastard child', it's a perfectly normal Linux distribution. It just happens to include a copy of WINE with it, which is a wrapper layer that allows Windows applications to run on Linux in many cases, as long as they don't depend on anything that WINE hasn't implemented yet.

You can already run WINE on the Xbox, on any Xbox Linux distribution you want. You could get Xandros to run on the Xbox if you switched the kernel out for one compiled with the xbox-linux patches, if you wanted.

#27 gronne

gronne

    X-S X-perience

  • XS-BANNED
  • PipPip
  • 345 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 05 July 2006 - 01:18 PM

Ok, Torne. You seem to have an incredible understanding of this, but why haven't you or a team started working on it? There's no need to wait I reckon. Or has something come up that makes it impossible? I'd be thrilled if we get pure windows on the xbox. And if the pictures we saw a few days ago from the 360 being hacked and running xbox 1 software, I'd say it'd be very useful.

I'm not a coder, and I'd suck at advance things like this anyway, but you seem to have an awful understanding, and interest, in this. So why not throw the dice?

#28 torne

torne

    X-S Expert

  • Members
  • PipPipPip
  • 684 posts
  • Location:London, UK
  • Interests:Reverse engineering, Linux, crazy operating systems voodoo, embedded development
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 06 July 2006 - 01:46 PM

QUOTE(gronne @ Jul 5 2006, 01:25 PM) View Post

Ok, Torne. You seem to have an incredible understanding of this, but why haven't you or a team started working on it?

If you read my initial post in this topic you will see my primary reason for not doing it: I am 'tainted' by having read and worked on large portions of the Windows source code under a non-disclosure agreement. The agreement's terms are complicated and I'm not convinced it would be legal for me to work on this kind of reverse-engineering project (though it's hardly clear). All the advice I have given in this forum is stuff anyone with a bit of OS development experience could work out from a Windows Internals book without ever having looked at the source (legitimately or otherwise).

The other reason is that I have a tiny attention span. smile.gif

#29 Trav41514

Trav41514

    X-S Enthusiast

  • Members
  • 5 posts
  • Location:Australia
  • Interests:Programming, Games, Hacking devices.
  • Xbox Version:v1.1
  • 360 version:none

Posted 07 July 2006 - 12:45 AM

the real reason i want to get DOS up and running is because with XPe, you need to run a program called TA.exe (target analysiser) with only runs on win 2000 or xp (not gonna happen with the xbox at a guess) or on ms dos (16 bit)

i guess the other reason is because it would be cool to have dos on the xbox :-)

#30 torne

torne

    X-S Expert

  • Members
  • PipPipPip
  • 684 posts
  • Location:London, UK
  • Interests:Reverse engineering, Linux, crazy operating systems voodoo, embedded development
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 07 July 2006 - 12:39 PM

QUOTE(Trav41514 @ Jul 7 2006, 12:52 AM) View Post

the real reason i want to get DOS up and running is because with XPe, you need to run a program called TA.exe (target analysiser) with only runs on win 2000 or xp (not gonna happen with the xbox at a guess) or on ms dos (16 bit)

You don't need to run target analyser to build an XP Embedded image. All TA does is detect what drivers are needed by the device, which you can determine for yourself for the xbox (if you don't know already what the devices are, boot xbox-linux and run lspci to see what's on the PCI bus). Some of the Xbox's hardware will have no matching driver in XP Embedded anyway (video, at least). You can just choose which drivers to include manually.

But.. XP Embedded isn't going to work on the Xbox any more than regular XP is - the problems required to be solved to get it to work are the same. Both require NTLDR to bootstrap themselves (which won't work without modification), and both will kill themselves by touching the 'broken' bit of the PCI bus.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users