[Info-vax] How much of VMS is still in MACRO-32?

Camiel Vanderhoeven iamcamiel at gmail.com
Sun May 30 04:34:19 EDT 2021


Op zondag 30 mei 2021 om 00:15:18 UTC+2 schreef Stephen Hoffman:

> Some few parts of the kernel do tend to be written in the 
> platform-native assembler; in Macro64 on Alpha, and IAS on Itanium, and 
> as-yet-unspecified AT&T and/or Intel syntax assembler on x86-64. 

AT&T Syntax. Some key kernel modules (most of which I wrote), and some helper routines in various places, but a lot less assembler code than we have on Itanium. On Itanium, we have ~260 IAS modules (~85 if you exclude the MATH library) in the base OS. On x86-64, we have 32 assembler modules, a majority of these contain just a few very small helper routines (like shuffling arguments into the correct registers to call UEFI firmware procedure). About 10 of these are substantial modules. The most substantial assembler modules are those that deal with initial interrupt/exception handling, system service calling, and AST delivery; those are the modules where we make the switch between Kernel, Executive, Supervisor, and User mode. They have to be written in assembly language, because we need to (a) exercise complete control over what goes into (and comes out of) which of the x86 registers, and (b) do things like change the stack pointer, page tables, etc. that would be impossible to do in C and survive. Even so, we're limiting these in scope, switching to C as soon as possible. A good example is the main scheduler loop. It was written in MACRO-32 on the VAX, MACRO-64 on Alpha, and in IAS on Itanium. On x86-64, it's written in C, calling on an assembly routine only to do the minimum bit of context changing that couldn't be done in C. We've gone from 1200 lines of Itanium assembly to 200 lines of C code + 150 lines of x86-64 assembler code.

Camiel



More information about the Info-vax mailing list