In the realm of microcomputers specifically, the BBC Micro of 1981 had a very sophisticated kernel in ROM for a machine of its class. There were a number of defined entry points that both language ROMs and user programs were expected to use to interface with the hardware.
Programs which relied exclusively on these interfaces could expect to run correctly on future versions of the BBC Micro and on the 6502-based incarnations of the Second Processor expansions. Much of this functionality was exposed in a programmer-friendly manner by the included version of BASIC.
For example, to draw text or graphics on the screen, you were expected to send ASCII characters, control codes and escape sequences to the VDU driver through the OSWRCH entry point at &FFEE - which was always present, even if the display memory had been remapped into the shadow bank (on the Master) or simply didn't exist in your memory space (on the Second Processor). Most graphics operations could be specified through a six-byte escape sequence corresponding to the BASIC PLOT statement. To check the colour of a pixel, or to perform a variety of auxiliary operations such as hiding the text cursor, the more general OSBYTE entry point could be used.
Some games found this interface too restrictive for adequate performance, so they had to access display memory directly. These games were consequently incompatible with the Second Processor and Shadow RAM, but could still be run on a machine so equipped, by temporarily disabling those features.
Other entry points dealt with handling a very basic command shell, filesystem operations (abstracted so that you didn't need to care about tape/floppy/HDD/network differences), and so on.
This approach to constructing an operating system was considered so successful that it was copied very closely in the subsequent Acorn Archimedes series, which introduced the now-ubiquitous ARM CPU to the world.
The story goes that a more professional microkernel-based OS (ARX) was being developed for the Archimedes, but that it was so slow and memory-hungry that it would have ruined the machine for its intended market. A large part of that was because it was written in Modula-2 via an incredibly inefficient compiler; to multiply two integers it would emit 25 ARM instructions and then call a subroutine. (The ARM2 could already do that with a single instruction.)
A demo was arranged, where the ARX devs proudly showed off sixteen clocks running on their desktop - under which load their top-of-the-line 4MB machine was swapping heavily, and each clock only updated every several seconds. The other team came in with a 256KB machine running the MOS-derived OS (Arthur), and they had sixteen clocks written in BBC BASIC, all running smoothly. ARX was cancelled the next day, and Arthur eventually became RiscOS.
Yes, that means you can still call OSWRCH and OSBYTE natively on a Raspberry Pi!