Progress "BLOG"

A Linux Kernel hosted by PocketPC

Progress "BLOG"

Postby hns on Sat Jun 12, 2004 10:53 am

Here, I will report status and progress from time to time.

The current status is:
1. eVC++ 4.0 has been installed and set up
2. a project has been defined
3. Classes "File", "Process", "System" have been defined
4. some code has been added to process the main system calls (e.g. open(), close(), dup(), getpid())
5. The Linux source tree has been analysed to find out the location of some important definitions: mainly errno.h, signal.h and the system call codes

The next step will be to integrate 4 & 5 by adding 5 to the file system.
Site Admin
Posts: 328
Joined: Tue Apr 27, 2004 8:06 pm

Postby hns on Sat Jun 12, 2004 5:31 pm

Some more desctription about the planned architecture:

The user will install an executable kernel (PocketTux.exe) and a file system on his PocketPC device. Then, he can launch the executable kernel like any other application.

This kernel first initializes itself and creates a first /bin/init process. Then it starts scheduling the processes managed by the kernel. This makes the /bin/init binary execute. As this binary will be compiled as a standard ARM-Linux executable (ELF) format, the kernel will load it into its memory and start executing ARM instructions.

This code will start doing system calls. System calls coming from this code will be directed into the kernel which looks up and executed the system call handler for this call in the current process context.

Device access calls (terminal, frame buffer, disk files) are then translated into the appropriate PocketPC system calls handled by the hosting operating system.

This, of course will need some work to gain enough compatibility, as I have no idea about how rich the useage of the Linux system calls are in the /bin/init binary. We might e.g. need to implement most of them to get just the /bin/init running.

Mapping device drivers might also be a lot of bit-fiddling, as we have to map the usual Linux API by using /proc and /dev as well as ioctl() and map this to the PocketPC counterparts for accessing devices like
* Disk (Flash, internal memory, micro disk drives in CF slot)
* Touchscreen (framebuffer)
* Sound
* Battery manager
* Serial, Infrared, Bluetooth, WiFi
* TCP/IP sockets

And, there is one area which might need a lot of thoughs: memory management. Linux processes assume to have strictly separated virtual memory spaces which can be expanded on demand. This needs to be mapped by the kernel process - which might need support from the Memory Management Unit of the ARM processor. And this is not permitted to interfere with the PocketPC memory management...

So, some additional thoughts to be thought.

-- hns
Site Admin
Posts: 328
Joined: Tue Apr 27, 2004 8:06 pm

Postby hns on Sun Jun 13, 2004 1:04 pm

A new thought is coming up:

one of the first system calls issued by a Linux executables might be loading a shared library. So, the shared library mechanism might be one of the first things to implement.

But finding out will be easy as soon as the first executable code is loaded and the first system calls get forwarded to the kernel. We just print a log on yet unimplemented system calls...
Site Admin
Posts: 328
Joined: Tue Apr 27, 2004 8:06 pm

Postby hns on Sun Aug 08, 2004 10:42 am

So, after a while I have started to understand how PocketPC and VC++ are working together...

Now, I have a first (0.0.1) proof-of-concept version working that does the following:
1. initialize everything
2. make a /dev/console out of the main window
3. try to execve("/sbin/init") - which fails of course

This works with the MS emulator and just needs nome cosmetic changes until I will make it public.
Site Admin
Posts: 328
Joined: Tue Apr 27, 2004 8:06 pm

Return to PocketTux

Who is online

Users browsing this forum: No registered users and 1 guest