6 #include <kvm/assembly.h>
11 * 1) The code is supposed to enter with CS somewhere in BDA_START area so prepare real mode
12 * interrupt table properly (if you screw it up -- there is no way to restore
13 * anything, the code is NOT PORTABLE by any means, it's BIOS after all)
15 * 2) We switch to own stack which is BIOS_STACK_SIZE bytes long saving all caller's
16 * data we clobber. The stack is not that deep so mask interrupts at entry and dont
24 mov %ss, %\seg:(ss_old)
25 mov %sp, %\seg:(sp_old)
26 mov %si, %\seg:(stack_clobber)
27 mov $BIOS_STACK_SEG, %si
29 mov $BIOS_STACK_SIZE, %sp
30 mov %\seg:(stack_clobber), %si
34 mov %\seg:(ss_old), %ss
35 mov %\seg:(sp_old), %sp
38 .macro opcode_switch ocode, label
44 * int 10 - video - write character and advance cursor (tty write)
47 * bh = display page (alpha modes)
48 * bl = foreground color (graphics modes)
50 * We ignore bx settings
54 opcode_switch $0x0e, putchar
58 * put char in AL at current cursor and
59 * increment cursor position
67 mov $VIDEO_BASE_SEG, %bx
91 * must be last in this file
96 stack_clobber: .word 0
97 ENTRY_END(___int10_end)