CE7/Windows Phone 7 - The Kernel, Memory Management, etc.

Search This thread

Da_G

Inactive Senior RD / Moderator Emeritus
Aug 20, 2007
3,332
1,563
Riverside, CA
Samsung Galaxy S22 Ultra
Similar to the CE5 kernel that we're used to, the CE7 kernel is a 32 bit OS and runs a 4GB Virtual Address space. Similar to CE5, 2GB is reserved for the kernel and 2GB is reserved for user space.

This is where it begins to differ. CE5 handled the user space by splitting the process memory up into 32 slots of 32MB each. (This accounts for 1GB of user space, the rest is used for memory mapped files, fixed up modules, etc.) Any app currently in the foreground was swapped into slot 0 during execution, and swapped back into it's slot while it's backgrounded.

CE7 similarly uses 1GB for the process code, however now it's handled differently. Each running process is mapped to the entire 1GB space, allowing the full 1GB of VM available for use without the trickery needed to accomplish using more than 32MB of VM in CE5. This should allow for much more rich apps to be developed (whenever MSFT decides to allow us to write native code, which is coming at some point...)

This 1GB VM space will be dedicated to the process, and not accessible by any other process. The remaining 1GB of user space has to be utilized for inter-process memory sharing.

There are 256 priority levels as with CE5, for each individual thread within an app. Scheduling is handled on a round-robin basis for threads sharing the same priority level. Priority level 0 functions as a "real time" priority level and any thread running at this level will run through til completion before the scheduler runs another thread. True multitasking will not be accessible to programmers initially, though MSFT intends to unlock that later down the line (presumably around the time native code is allowed). There is no hard limit to the number of threads a program can utilize, it is only limited by the system resources available.

Regarding the limited APIs available to us "normal" programmers - OEMs and MOs will have access to an extended set of Managed APIs and a limited set of Native APIs that "normal" programmers won't get access to. This likely includes things like RIL.
 
Last edited:
C

conflipper

Guest
Just give me an ARM build of it that is already ported over to run MSM7x00.


Thank you
 

RustyGrom

Senior Member
Apr 18, 2006
1,006
83
Orlando
Similar to the CE5 kernel that we're used to, the CE7 kernel is a 32 bit OS and runs a 4GB Virtual Address space. Similar to CE5, 2GB is reserved for the kernel and 2GB is reserved for user space.
Are you sure it's CE7 and not CE6? Tweakers.net (which appears to have received the same docs you have) says it's 6 and 6 makes much more sense to me being that CE7 hasn't RTM'd yet.
 
Last edited:

Da_G

Inactive Senior RD / Moderator Emeritus
Aug 20, 2007
3,332
1,563
Riverside, CA
Samsung Galaxy S22 Ultra
Yes, i'm sure it's CE7. The docs do in fact say CE6 but the docs are dated, things move fast, and that's no longer the case :)

CE7 "Chelan" will likely RTM around the same time WP7 does.
 

AdamiX

Senior Member
May 24, 2009
412
14
Bratislava
Windows 7, Windows Phone 7, so CE must be 7 :D

What do u mean by "much more rich apps". 3D Games or what? I think that aplications on WM 6.5.5 are good and fast. Can u explain that rich applications?
 

mlin

Senior Member
Dec 27, 2007
4,634
1,221
Awesome information! Thanks and keep it coming; I can't wait for WP7 to be released!
 

link8506

Senior Member
Jan 20, 2007
155
4
Toulon
www.julien-manici.com
This should allow for much more rich apps to be developed (whenever MSFT decides to allow us to write native code, which is coming at some point...)
[...]
(presumably around the time native code is allowed).

what makes you think that microsoft is going to allow developpers to write native code on windows phone 7?

the whole wp7 sandbox architecture is based on .net, so it's hard to imagine that microsoft would allow native code...

aren't they going to allow it only on windows phone 7 "business edition", which much users won't have ? that would make sense...
 

dazza9075

Senior Member
Jul 22, 2007
2,858
493
Suffolk
if they do that then we are in luck the guys on here will eventually pull it apart and give it to us all, i serously doubt thats going to happen tho, i suspect 6.5 code base will continue side by side until devs support WP7 at which point there wont be such a big outcry.
 

RustyGrom

Senior Member
Apr 18, 2006
1,006
83
Orlando
FWIW I was told by members of the WP7 team that it's CE6. They weren't directly related with that aspect and weren't 100% certain (more like 99%) though.
 

Ganondolf

Senior Member
Nov 16, 2008
1,255
12
FWIW I was told by members of the WP7 team that it's CE6. They weren't directly related with that aspect and weren't 100% certain (more like 99%) though.

A MS spokesman has confirmed it is running on a hybrid CE6 R3 (meaning CE6 R3 + added features that are from CE7). No doubt in my mind that a update in a year or so after launch they will update it to the full CE7.
 

mrcrassic

Senior Member
Sep 28, 2007
353
32
New York
While this is quite interesting, I have a couple of questions about this. First, since each process is now free to use the entire slice of memory assigned to userspace, does this mean that it now conducts multitasking similar to iPhoneOS and Android where it saves the application's state when backgrounded instead of the entire process itself? How does the OS handle background activities, such as background network transfers and job completions?

This leads me to my second question. Since memory allocation is done on a round-robin basis, does this mean that all backgorund activity (if backgrounded) must be completed within a certain amount of time? (For those unfamiliar with OS concepts, round-robin scheduling is a method some OSes employ where it gives a pool of jobs a set amount of time, a quantum, to complete their work. If some job in the pool doesn't finish by the end of that quantum and another job needs resources, that job is killed off in favor of the new one. More information here.) Or is the activity suspended until whatever process needs the memory is finished using it?

Thanks for the scrutinous research!
 

RustyGrom

Senior Member
Apr 18, 2006
1,006
83
Orlando
If you're referring to 3rd party apps, there is no multitasking for 3rd party apps. Depending on what the user does, the app will be "tombstoned" (application state saved).
 

Tom Servo

Senior Member
Aug 1, 2009
290
29
It says 7 as in Windows Phone 7.
Why would it say "Windows CE" and then append a version number that doesn't apply?

Anyway, even if it runs a WinCE 6 hybrid kernel, I hope there's SMP support there. I'd like to see a Tegra based phone. Such a device however would be a terrible waste of CPU power, if the system can't use both cores.