Lines Matching +full:supervisor +full:- +full:mode
22 .set MEM_ESP0,0x1800 # Supervisor stack
24 .set MEM_ESPR,0x5e00 # Real mode stack
44 .set PSL_VM,0x00020000 # Virtual 8086 mode flag
49 .set SEL_SCODE,0x8 # Supervisor code
50 .set SEL_SDATA,0x10 # Supervisor data
51 .set SEL_RCODE,0x18 # Real mode code
52 .set SEL_RDATA,0x20 # Real mode data
92 .set SCR_MAT,0x7 # Mode/attribute
99 .set BDA_SCR,0x449 # Video mode
106 .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base
107 .set _TSSLM,MEM_TSS_END-MEM_TSS # TSS limit
108 .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit
124 .word PAG_CNT-MEM_ORG>>0xc # Paging control
125 .word break-start # Text size
142 mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero
143 rep # Zero-fill
146 * Update real mode IDT for reflecting hardware interrupts.
150 mov $0x20*4,%di # First real mode IDT entry
190 mov $0x2820,%bx # Set protected mode
195 inc %ax # mode
197 ljmp $SEL_SCODE,$init.8 # To 32-bit code
200 movb $SEL_SDATA,%cl # To 32-bit
234 iret # To user mode
257 exit.1: mov $SEL_RDATA,%cl # 16-bit selector
264 * To real-address mode.
267 mov %eax,%cr0 # real mode
269 exit.2: xor %ax,%ax # Real mode segment
272 mov $0x7008,%bx # Set real mode
340 jmp ex_noc # Floating-point error
357 cmpw $SEL_SCODE,0x44(%esp,1) # Supervisor mode?
395 * Protected Mode Hardware interrupt jump table.
431 * Invoke real mode interrupt/function call from user mode with arguments.
433 intx31: pushl $-1 # Dummy int no for btx_v86
435 * Invoke real mode interrupt/function call from protected mode.
438 * which will reenter protected mode and then finally return to the user
441 * Kernel frame %esi points to: Real mode stack frame at MEM_ESPR:
443 * -0x00 user %ss -0x04 kernel %esp (with full frame)
444 * -0x04 user %esp -0x08 btx_v86 pointer
445 * -0x08 user %eflags -0x0c flags (only used if interrupt)
446 * -0x0c user %cs -0x10 real mode CS:IP return trampoline
447 * -0x10 user %eip -0x12 real mode flags
448 * -0x14 int no -0x16 real mode CS:IP (target)
449 * -0x18 %eax
450 * -0x1c %ecx
451 * -0x20 %edx
452 * -0x24 %ebx
453 * -0x28 %esp
454 * -0x2c %ebp
455 * -0x30 %esi
456 * -0x34 %edi
457 * -0x38 %gs
458 * -0x3c %fs
459 * -0x40 %ds
460 * -0x44 %es
461 * -0x48 zero %eax (hardware int only)
462 * -0x4c zero %ecx (hardware int only)
463 * -0x50 zero %edx (hardware int only)
464 * -0x54 zero %ebx (hardware int only)
465 * -0x58 zero %esp (hardware int only)
466 * -0x5c zero %ebp (hardware int only)
467 * -0x60 zero %esi (hardware int only)
468 * -0x64 zero %edi (hardware int only)
469 * -0x68 zero %gs (hardware int only)
470 * -0x6c zero %fs (hardware int only)
471 * -0x70 zero %ds (hardware int only)
472 * -0x74 zero %es (hardware int only)
485 movl %esp,MEM_ESPR-0x04 # Save kernel stack pointer
486 movl -0x14(%esi),%eax # Get Int no
487 cmpl $-1,%eax # Hardware interrupt?
490 * v86 calls save the btx_v86 pointer on the real mode stack and read
497 addl -0x4(%esi),%ebx # User ESP
500 movl %edx,MEM_ESPR-0x08 # Save btx_v86 ptr
503 movl -0x08(%esi),%ebx # Save user flags in %ebx
518 movl %edx,MEM_ESPR-0x08 # NULL btx_v86 ptr
524 * Look up real mode IDT entry for hardware interrupts and VM86 INTx
546 * %ebx now holds the %eflags to pass to real mode.
549 intusr.5: movw %bx,MEM_ESPR-0x12 # Pass user flags to real mode
554 movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr
556 leal -0x44(%esi),%edi # %edi => kernel stack seg regs
563 intusr.6: movl -0x08(%esi),%ebx # Copy user flags to real
564 movl %ebx,MEM_ESPR-0x0c # mode return trampoline
566 movl %ebx,MEM_ESPR-0x10 # CS:IP
567 movl %eax,MEM_ESPR-0x16 # Real mode target CS:IP
568 ljmpw $SEL_RCODE,$intusr.7 # Change to 16-bit segment
572 movl %eax,%cr0 # mode
583 movw $MEM_ESPR-0x16,%sp # Switch to real mode stack
586 * For the return to real mode we setup a stack frame like this on the real
587 * mode stack. Note that callf calls won't pop off the flags, but we just
591 * -0x04 kernel %esp
592 * -0x08 btx_v86
593 * -0x0c %eax
594 * -0x10 %ecx
595 * -0x14 %edx
596 * -0x18 %ebx
597 * -0x1c %esp
598 * -0x20 %ebp
599 * -0x24 %esi
600 * -0x28 %edi
601 * -0x2c %gs
602 * -0x30 %fs
603 * -0x34 %ds
604 * -0x38 %es
605 * -0x3c %eflags
607 rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer
622 inc %ax # mode
624 ljmp $SEL_SCODE,$rret_tramp.1 # To 32-bit code
628 movw %cx,%ss # 32-bit
631 movl MEM_ESPR-0x04,%esp # Switch to kernel stack
637 * Now we are back in protected mode. The kernel stack frame set up
638 * before entering real mode is still intact. For hardware interrupts,
641 cmpl $0,MEM_ESPR-0x08 # Leave saved regs unchanged
644 * For V86 calls, copy the registers off of the real mode stack onto
651 leal -0x18(%esi),%edi # Kernel stack GP regs
653 movl $MEM_ESPR-0x0c,%esi # Real mode stack GP regs
655 rep # real mode stack
662 * For V86 calls, copy the saved seg regs on the real mode stack back
666 movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr
668 leal MEM_ESPR-0x2c,%esi # %esi => real mode seg regs
671 rep # from real mode stack
677 movl MEM_ESPR-0x3c,%eax # Read real mode flags
679 movw %ax,-0x08(%esi) # Update user flags (low 16)
689 iret # Return to user mode
738 testl $PSL_VM,0x50(%ebx) # V86 mode?
756 movb $'-',%al # Separator
803 * Output zero-terminated string [ESI] to the console.
899 movb $SCR_MAT,%ah # Mode/attribute
903 cmpb %ah,BDA_SCR-BDA_POS(%ebx) # Mono mode?
924 movw $(SCR_ROW-1)*SCR_COL/2,%cx # Words to move
931 movb $SCR_ROW-1,%dh # Bottom line
939 * Real Mode Hardware interrupt jump table.
974 * Reflect hardware interrupts in real mode.
1006 * Pseudo-descriptors.
1008 gdtdesc: .word gdt.1-gdt-1,gdt,0x0 # GDT
1010 ivtdesc: .word 0x400-0x0-1,0x0,0x0 # IVT
1014 idtctl: .byte 0x10, 0x8e # Int 0x0-0xf
1018 .byte 0x10, 0x8e # Int 0x20-0x2f
1022 .byte 0x2, 0xee # Int 0x31-0x32