And, apparently, the watch on Palm OS will find its buyer:
Palm OS is an operating system for handheld computers, which was at the peak of popularity from 1998 to the first half of the 2000s. It is very simple and not demanding of resources, it carefully consumes battery power and is wonderfully designed for use in handheld computers. But in 2004–2005, Palm OS devices gave way to Windows Mobile devices:
This happened for various reasons, partly due to management errors, and partly due to the characteristics of the operating system itself: in 2004, Palm OS was dragging behind itself a long tail of backward compatibility that prevented it from developing and moving forward. What cost, for example, the lack of memory protection: an error in the application could lead to the whole system hang or crash, as in the days of Windows 9x or Mac OS 9. Or the implementation of the file system: the files were stored as records in the database, and the size of one record could not exceed 64 kilobytes. It was probably a good decision in 1996, but such a data storage system turned out to be unsuitable for large multimedia files and memory cards that appeared later.
Well, you can not ignore the change of architecture in Palm OS 5.0 with Motorola 68k to ARM. Then, for compatibility with old applications, a binary translator was added to the operating system, which on the fly recoded the instructions from M68k to ARM. In principle, even with such a layer, old applications worked on new processors no worse than on native 68K, because Palm OS system calls were natively executed on ARM, and the performance loss from translation leveled off the increased frequency of new processors several times compared to Motorola Dragonball. The real problem was that the developers did not get the tools to create native ARM applications. The code for Palm OS 5 was still compiled under 68k, and even standard applications worked through the compiler layer.
Nevertheless, despite the many architectural features of the Palm OS, its strengths have not ceased to be strong. This is still a simple, low-level, resource-undemanding system. In 2015, I used the Palm Pilot with a 16 MHz processor as a diary, and I was completely comfortable! Moreover, many people loved this system for its simplicity, and many had enough basic applications. Readers, players, diaries and planners, games - all this exists under the Palm OS in abundance. Find the use of this operating system today.
Therefore, after so many years, the community of fans of this system has been preserved, which maintains websites with applications, maintains its own subreddit and continues to use palm trees.
But one of the community members went further, deciding to move Palm OS to a more modern hardware and find useful use for this project.
Dmitry Greenberg, a programmer from Google, has been creating tweaks and hacks for Palm OS devices since 2003, including WarpSpeed, a program for overclocking a PDA, and PowerSDHC, a driver for SDHC memory cards.
In Google, Dmitry was engaged mainly in embedded systems. In particular, he participated in the development of the operating system for Android Wear smart watches, Nexus Q media player and Android TV platform.
Having quit Google, Dmitry decided to create a platform for smart watches based on Palm OS 5.x, an operating system that was last updated 15 years ago:
At first glance, the plan is excellent: it is unlikely that modern platforms for smart watches will compare with Palm OS in terms of resource consumption and battery life.
The problem is that the source code of Palm OS has never been published. Yes, some pieces of source code appeared in open access to application development textbooks, but this is not enough. The source code was from the company PalmSource and the licensees, mainly companies that produced their devices on the Palm OS - under the terms of the NDA, of course. Therefore, to find the source code of this operating system after so many years is not possible, and the legality of its use will be questionable.
It remains a difficult and thorny path for the most hardcore enthusiasts with reinforced concrete willpower: reverse engineering. It was this path that Dmitry chose, gradually, in several stages, realizing his plans.
For starters, you should have written a tool for unpacking ROM images of Palm OS devices. Then it was necessary to disassemble the main components of the operating system, obtained from the unpacked image. Then - the longest and monotonous work - it was necessary to understand the logic of the functions of the system API and write your own implementation of these functions. And the most difficult thing is to write the kernel of the operating system, since the already existing ones (for example, linux) do not support some of the functions of the Palm OS kernel (suspending threads, turning on / off preemptive multitasking).
Read the full history of rewriting Palm OS from scratch can be in the blog Dmitry , I will only briefly retell the implementation of the main stages. Dmitry spent several months implementing system APIs, which would be enough to load the OS. A few more weeks - on the reverse-engineering of the graphics subsystem, and two months - on writing code to support drawing. At this point, the implemented functionality was enough to run the operating system on top of the linux kernel in QEMU, and load the image of some Palm OS device in this environment.
rePalm's FIRST boot (c) Dmitry Grinberg
To move from an emulator to a real hardware, many more tasks needed to be done: choose a well-documented and stably working hardware platform, write the OS kernel for the selected architecture, write the ARM translator to Thumb while many Palm OS components use full 4-byte ARM instructions), and write the JIT compiler (!!!) so that the M68k -> ARM -> Thumb double translation works at an adequate speed.
After a year of active development, rePalm runs on the STM32F429 debug board, graphics, touchscreen and SD cards work, synchronization via HotSync works, as well as most applications and games written for Palm OS 5.x. The plans include Wi-Fi and Bluetooth support, sound support and USB device connection in mass storage mode, and SSL library update. Dmitry completes his blog post as he develops, and also regularly posts updates to the project in the r / Palm subreddit .
(c) Dmitry Grinberg
It is pleasant to follow the work of an enthusiastic person and observe how an interesting and ambitious project develops. But it is worth remembering that Dmitry is primarily an engineer and a programmer. For him, the solution of the engineering problem (bringing the Palm OS into line with the modern world) is higher than creating a commercial product, be it a smart watch or something else. I am sure that there will be a lot of interesting applications for the project, but what will happen next, and we’ll see a modern version of Fossil WristPDA — hard to say. It remains only to wish Dmitry good luck and follow the development of rePalm.
(c) Dmitry Grinberg
PS Thanks to Newbilius for the thought of posting this article here from the blog. Such cool projects should know more people!
Source: https://habr.com/ru/post/452692/
All Articles