Thursday, October 15, 2009

initfs

When DGOS boots, it has no filesystem or device drivers. This is a problem since the filesystem and block device drivers are modules - files on the filesystem. We are thus left with a chicken-and-egg scenario that we need the filesystem access to load modules and we need the filesystem modules to have filesystem access. This is solved using initfs. This is a simple flat filesystem in ram that has just the bare minimum modules required to bring up the filesystem and device support needed to load the rest of the system. The bootloader loads two files to RAM. The kernel and the initfs image. The kernel then uses the initfs image to load the modules needed to access the main filesystem. initfs memory is then freed, and with this new ability to read the filesystem the kernel can go on booting.

DGOS used to have a very simple initfs FS and init_blk block device in it. I decided to replace initfs with just FAT, since it is simple, and there is little harm in compiling it into the kernel. This also means that the initfs image for most devices will now contain just one module - the block device driver for SD card (or in the case of lifedrive - two: SD and HDD drivers). FAT driver will now be part of the kernel and thus doesn ot need to be a module in initfs.

8 comments:

Derek said...

On any given post, I think I only understand about 1/2 of what you describe. Learning about what the other 1/2 means has been fun.

Thanks for keeping us up-to-date.

Jacob101980 said...

Wow small device loader used to load another loader, i wonder how long boot time would be but anyway this is an awesome project.

But if you dont mind can we send you ideas for a bootscreen?

Dmitry Grinberg said...

m Os loads in 5-6 stages. I have 2. First is in lifedrive flash (like poverdrive loader but expanded with fat32 driver). It loads initfs and kernel to ram. Second stage is kernel booting after which which the system is already "up".

Ideas are always welcome, but I suggest posting them as comments here instead of email. This way they will not get lost.

brum said...

Don't know whether you've heard but webOS isn't coming to Asia for the foreseeable future(http://www.precentral.net/rumor-australia-miss-out-all-palm-fun), this could open up flood gates for DGOS. Here's hoping... I'm finally, officially in.

Coffee-Turtle said...

Wow! This is great information! It's also great to see how things are developing every step of the way. It was nice seeing the bootscreen in your previous post. Is DGOS going to be skinnable? I know it must take a lot of time getting a full GUI with all the artwork going. I guess DGOS will have elements of SkinUI.

Dmitry Grinberg said...

Skinnable? Why not? All of the ui is provided by one library, which you can replace as you wish :)

NickyX3 said...

Дмитрий, я лично, как и оставшиеся еще в России пользователи Palm с надеждой смотрят на продвижение работ над этим проектом. Лично у меня до сих пор работают два TT|3 и надеюсь DGOS сможет на них работать?

Unknown said...

Уверен, многие задавали этот вопрос, но, пожалуй задам его тут сам. Почему бы все же не сделать девелоперский раздел, не открыть svn. Зачем взваливать на себя столько работы, если есть люди, которые за честь примут помочь в разработке. Многие, ведь прекрасно знают линукс. Я напр один из девелоперов openwrt, задачи там те же, в девайс с минимумом памяти, от 2мб, вписать загрузчик, ядро и нужные приложения. Глядишь все вместе и быстрей бы дописали. В конечном итоге лицензия и копирайты твой, закончили проект, закрывай доступ на скачку исходников, лучшие девелоперы получают ограниченный доступ, а пользователи покупают конечный продукт..