i had a need the other day to do an e820 scan from a kernel without the plan 9 realmode business. since switching back to realmode seems a bit problematic, and i have no need for realmode in the stuff i'm doing, i wanted to do it before the switch to protected mode, which happens in 9load. so i added it to 9load's l.s. (adventures in programming in machine language.)
l.s does the e820 calls to get the memory map and stuffs them in a safeish place in low memory and stores the count of records. this is enough to avoid the 820 scan later on. the stuff in e820.c is not necessary. it just exports the memory ranges from the e820 scan in a conf variable, "e820" and optionally prints out the results of the scan. (*e820print) source is in /n/sources/contrib/quanstro/9loadaoe/ i don't know if you can rightly call real820.s "source", but the meat of the operation is there. enjoy. - erik
