The ZX81 BASIC (and "OS", such as it was) was written by Steve Vickers, and everything fitted into an 8K ROM. I have always been impressed by this guy's work. The whole unit had only 4 chips (ROM, RAM, CPU and a custom chip). Scroll done for a photo: http://oldcomputers.net/zx81.html
Steve Vickers went on to create the Jupiter Ace (with the main ZX81 hardware guy), which had similar hardware, but instead of BASIC, it had Forth.