xbox OS ...

This is a discussion on xbox OS ... within the Tech Board forums, part of the Community Boards category; HI I just was courious on how microsoft made the xbox OS?? did they use c++ or c++ and ASM?? ...

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    32

    xbox OS ...

    HI I just was courious on how microsoft made the xbox OS?? did they use c++
    or c++ and ASM??

    How could I make games for the xbox console?? I just want to make games for myself just to learn how it's done.

    fun to think about.

  2. #2
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    To make a game for xbox console you would have to have a dev-kit and it's development tools. I think you have to pay a lot of money for those. The cheaper way is to deal with C# and microsoft's XNA studio which uses .net and is compatiable with the 360. There is an ongoing contest by microsoft for these types of games, one of which is going to get on the Live Arcade soon. That's the most I know, may be iffy on some parts.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If I've understood things right, the verion of "Windows" that runs on the original XBox is related to Windows CE, which is written mostly in C/C++ with a bit of assembler. Drivers for WinCE are written in C++. I don't know what the XBox 360 OS is like, but I would guess it's just an improved version of the previous OS.

    All OS's need at least some amount of assembly code, because (at the very least) parts of the "context switch" (when the OS switches between one thread or process and another) requires direct access to the registers in the processor. It is possible to write an OS with about 20-50 lines of assembler and the rest written in C/C++. Most OS's have a bit more assembler, because there are some other things that are tricky in C and/or perform better if you write them in assembler, such as the very low level of interrupt handling, exception handling and system call functionality.

    --
    Mats

  4. #4
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    Posts
    258
    The Xbox runs a stripped version of Windows 2000's kernel that exposes an API built on DirectX 8.1 and other various fun things.

    If you're interested in writing stuff for your xbox, don't get your hopes too high, but it's possible to write (limited amounts of) things for it using a modded xbox (you need a modded version because every xbox game has a very special digital signature on the disk that comes from MS, so the xbox doesn't run anything 'bad') and something like OpenXDK.
    operating systems: mac os 10.6, debian 5.0, windows 7
    editor: back to emacs because it's more awesomer!!
    version control: git

    website: http://0xff.ath.cx/~as/

  5. #5
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    The link in my signature shows that xbox is based on Windows 2000, http://widefox.pbwiki.com/CPU however it suggests that it's not actually windows.

  6. #6
    Registered User
    Join Date
    Jul 2005
    Posts
    32
    any good ASM website that would teach most of it and also explain what parts of it is used today ect.

    or any OS dev site that would teach all low level programming and also how the hardware works together ect.
    ?

    I am aware of some of those kit's.

    I have an xbox and I don't play it, it's modded but never worked I think I got riped off on it, like I can only use retail cds ect, so I only have 3 or 4 games and got bored of it, I also hated xbox becuse of the games lacked realistic small details well their big for me.

    like hockey games from ea the don't have zombies anymore they used to in playstation, and when ps2 and xbox came out they forgot those details and focused more on the game play, I knew soon they were going to make the crowd near the rink 3d models, but when xbox first came out the first xbox games lacked detail of the crowd and 3rd party items they done well on the on ice game play I also knew they where going to make the ice trails off from the players skates, the ice cuts ect.

    I am not planning on going commerical, just for education, learning what's what.

    like digitial signatures I know what it is based on tech people talking about it ect, but I never seen what it is myself, seening is one thing then hearing.

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm sure you can find some website(s) that explains how an OS works, but essentially, the assembler needed for an OS (at minimum level) is the one to switch registers, so something like this:

    Code:
    struct context {
       int proc_id;
       void *sp;
       ...
    };
    
    struct context current;
    ...
    void context_switch(struct context *newctxt) 
    {
          __asm {
               push eax
               push ebx
               push ecx
               push edx
               push ebp
               push edi
               push esi
               mov  dword ptr current, eax
               mov  esp, 4[eax]     // Store stack pointer.
               mov  dword ptr newctxt, eax
               // Set "current" to "newctxt". 
               mov  eax, dword ptr current  
               mov  4[eax], esp
               pop  esi 
               pop  edi
               pop  ebp
               pop  edx
               pop  ecx
               pop  ebx
               pop  eax
        }
    }
    This saves and restores all x86 "general purpose" registers. You may also need to save/restore some other registers if you build a "proper" OS (where memory protection is used), for example CR3. And some OS's do use the segment registers, so those would have to be stored and restored.

    If you want to play a little bit with it, you could actually write a little threads program that uses the above code to switch from one thread to another in Windows or Linux.

    --
    Mats

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Xbox 360 Compatability
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 08-22-2008, 03:51 PM
  2. Detecting if OS is Windows???
    By Ktulu in forum Windows Programming
    Replies: 2
    Last Post: 11-19-2006, 01:49 AM
  3. a simple OS
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 06-06-2004, 10:47 PM
  4. Linux OS to Windows OS code
    By sw9830 in forum C Programming
    Replies: 2
    Last Post: 02-28-2003, 02:11 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21