COMPLETE.TXT
上传用户:jnzhq888
上传日期:2007-01-18
资源大小:51694k
文件大小:2624k
- 34582 shl bx,cl ! source segment
- 34583 #endif
- 34584 mov ds,bx
- 34585
- 34586 stos ! copy process number of sender to dest message
- 34587 add si,*2 ! do not copy first word
- 34588 mov cx,*Msize-1 ! remember, first word does not count
- 34589 rep ! iterate cx times to copy 11 words
- 34590 movs ! copy the message
- 34591 pop di ! restore di
- 34592 pop si ! restore si
- 34593 pop ds ! restore ds
- 34594 pop es ! restore es
- 34595 ret ! that is all folks!
- 34596
- 34597
- 34598 !*===========================================================================*
- 34599 !* exit *
- 34600 !*===========================================================================*
- 34601 ! PUBLIC void exit();
- 34602 ! Some library routines use exit, so provide a dummy version.
- 34603 ! Actual calls to exit cannot occur in the kernel.
- 34604 ! Same for .fat & .trp.
- 34605
- 34606 _exit:
- 34607 __exit:
- 34608 ___exit:
- 34609 .fat:
- 34610 .trp:
- 34611 sti
- 34612 jmp __exit
- 34613
- 34614
- 34615 !*===========================================================================*
- 34616 !* in_byte *
- 34617 !*===========================================================================*
- 34618 ! PUBLIC unsigned in_byte(port_t port);
- 34619 ! Read an (unsigned) byte from the i/o port port and return it.
- 34620
- 34621 _in_byte:
- 34622 pop bx
- 34623 pop dx ! port
- 34624 dec sp
- 34625 dec sp
- 34626 inb ! input 1 byte
- 34627 subb ah,ah ! unsign extend
- 34628 jmp (bx)
- 34629
- 34630
- 34631 !*===========================================================================*
- 34632 !* in_word *
- 34633 !*===========================================================================*
- 34634 ! PUBLIC unsigned short in_word(port_t port);
- 34635 ! Read an (unsigned) word from the i/o port and return it.
- 34636
- 34637 _in_word:
- 34638 pop bx
- 34639 pop dx ! port
- 34640 dec sp
- 34641 dec sp ! added to new klib.s 3/21/91 d.e.c.
- 34642 inw ! input 1 word no sign extend needed
- 34643 jmp (bx)
- 34644
- 34645
- 34646 !*===========================================================================*
- 34647 !* out_byte *
- 34648 !*===========================================================================*
- 34649 ! PUBLIC void out_byte(port_t port, int value);
- 34650 ! Write value (cast to a byte) to the I/O port port.
- 34651
- 34652 _out_byte:
- 34653 pop bx
- 34654 pop dx ! port
- 34655 pop ax ! value
- 34656 sub sp,#2+2
- 34657 outb ! output 1 byte
- 34658 jmp (bx)
- 34659
- 34660
- 34661 !*===========================================================================*
- 34662 !* out_word *
- 34663 !*===========================================================================*
- 34664 ! PUBLIC void out_word(port_t port, int value);
- 34665 ! Write value (cast to a word) to the I/O port port.
- 34666
- 34667 _out_word:
- 34668 pop bx
- 34669 pop dx ! port
- 34670 pop ax ! value
- 34671 sub sp,#2+2
- 34672 outw ! output 1 word
- 34673 jmp (bx)
- 34674
- 34675
- 34676 !*===========================================================================*
- 34677 !* port_read *
- 34678 !*===========================================================================*
- 34679 ! PUBLIC void port_read(port_t port, phys_bytes destination,unsigned bytcount);
- 34680 ! Transfer data from (hard disk controller) port to memory.
- 34681
- 34682 _port_read:
- 34683 push bp
- 34684 mov bp,sp
- 34685 push di
- 34686 push es
- 34687
- 34688 call portio_setup
- 34689 shr cx,#1 ! count in words
- 34690 mov di,bx ! di = destination offset
- 34691 mov es,ax ! es = destination segment
- 34692 rep
- 34693 ins
- 34694
- 34695 pop es
- 34696 pop di
- 34697 pop bp
- 34698 ret
- 34699
- 34700 portio_setup:
- 34701 mov ax,4+2(bp) ! source/destination address in dx:ax
- 34702 mov dx,4+2+2(bp)
- 34703 mov bx,ax
- 34704 and bx,#OFF_MASK ! bx = offset = address % 16
- 34705 andb dl,#HCHIGH_MASK ! ax = segment = address / 16 % 0x10000
- 34706 andb al,#HCLOW_MASK
- 34707 orb al,dl
- 34708 movb cl,#HCLICK_SHIFT
- 34709 ror ax,cl
- 34710 mov cx,4+2+4(bp) ! count in bytes
- 34711 mov dx,4(bp) ! port to read from
- 34712 cld ! direction is UP
- 34713 ret
- 34714
- 34715
- 34716 !*===========================================================================*
- 34717 !* port_read_byte *
- 34718 !*===========================================================================*
- 34719 ! PUBLIC void port_read_byte(port_t port, phys_bytes destination,
- 34720 ! unsigned bytcount);
- 34721 ! Transfer data port to memory.
- 34722
- 34723 _port_read_byte:
- 34724 push bp
- 34725 mov bp,sp
- 34726 push di
- 34727 push es
- 34728
- 34729 call portio_setup
- 34730 mov di,bx ! di = destination offset
- 34731 mov es,ax ! es = destination segment
- 34732 rep
- 34733 insb
- 34734
- 34735 pop es
- 34736 pop di
- 34737 pop bp
- 34738 ret
- 34739
- 34740
- 34741 !*===========================================================================*
- 34742 !* port_write *
- 34743 !*===========================================================================*
- 34744 ! PUBLIC void port_write(port_t port, phys_bytes source, unsigned bytcount);
- 34745 ! Transfer data from memory to (hard disk controller) port.
- 34746
- 34747 _port_write:
- 34748 push bp
- 34749 mov bp,sp
- 34750 push si
- 34751 push ds
- 34752
- 34753 call portio_setup
- 34754 shr cx,#1 ! count in words
- 34755 mov si,bx ! si = source offset
- 34756 mov ds,ax ! ds = source segment
- 34757 rep
- 34758 outs
- 34759
- 34760 pop ds
- 34761 pop si
- 34762 pop bp
- 34763 ret
- 34764
- 34765
- 34766 !*===========================================================================*
- 34767 !* port_write_byte *
- 34768 !*===========================================================================*
- 34769 ! PUBLIC void port_write_byte(port_t port, phys_bytes source,
- 34770 ! unsigned bytcount);
- 34771 ! Transfer data from memory to port.
- 34772
- 34773 _port_write_byte:
- 34774 push bp
- 34775 mov bp,sp
- 34776 push si
- 34777 push ds
- 34778
- 34779 call portio_setup
- 34780 mov si,bx ! si = source offset
- 34781 mov ds,ax ! ds = source segment
- 34782 rep
- 34783 outsb
- 34784
- 34785 pop ds
- 34786 pop si
- 34787 pop bp
- 34788 ret
- 34789
- 34790
- 34791 !*===========================================================================*
- 34792 !* lock *
- 34793 !*===========================================================================*
- 34794 ! PUBLIC void lock();
- 34795 ! Disable CPU interrupts.
- 34796
- 34797 _lock:
- 34798 cli ! disable interrupts
- 34799 ret
- 34800
- 34801
- 34802 !*===========================================================================*
- 34803 !* unlock *
- 34804 !*===========================================================================*
- 34805 ! PUBLIC void unlock();
- 34806 ! Enable CPU interrupts.
- 34807
- 34808 _unlock:
- 34809 sti
- 34810 ret
- 34811
- 34812
- 34813 !*==========================================================================*
- 34814 !* enable_irq *
- 34815 !*==========================================================================*/
- 34816 ! PUBLIC void enable_irq(unsigned irq)
- 34817 ! Enable an interrupt request line by clearing an 8259 bit.
- 34818 ! Equivalent code for irq < 8:
- 34819 ! out_byte(INT_CTLMASK, in_byte(INT_CTLMASK) & ~(1 << irq));
- 34820
- 34821 _enable_irq:
- 34822 mov bx, sp
- 34823 mov cx, 2(bx) ! irq
- 34824 pushf
- 34825 cli
- 34826 movb ah, #~1
- 34827 rolb ah, cl ! ah = ~(1 << (irq % 8))
- 34828 cmpb cl, #8
- 34829 jae enable_8 ! enable irq >= 8 at the slave 8259
- 34830 enable_0:
- 34831 inb INT_CTLMASK
- 34832 andb al, ah
- 34833 outb INT_CTLMASK ! clear bit at master 8259
- 34834 popf
- 34835 ret
- 34836 enable_8:
- 34837 inb INT2_CTLMASK
- 34838 andb al, ah
- 34839 outb INT2_CTLMASK ! clear bit at slave 8259
- 34840 popf
- 34841 ret
- 34842
- 34843
- 34844 !*==========================================================================*
- 34845 !* disable_irq *
- 34846 !*==========================================================================*/
- 34847 ! PUBLIC int disable_irq(unsigned irq)
- 34848 ! Disable an interrupt request line by setting an 8259 bit.
- 34849 ! Equivalent code for irq < 8:
- 34850 ! out_byte(INT_CTLMASK, in_byte(INT_CTLMASK) | (1 << irq));
- 34851 ! Returns true iff the interrupt was not already disabled.
- 34852
- 34853 _disable_irq:
- 34854 mov bx, sp
- 34855 mov cx, 2(bx) ! irq
- 34856 pushf
- 34857 cli
- 34858 movb ah, #1
- 34859 rolb ah, cl ! ah = (1 << (irq % 8))
- 34860 cmpb cl, #8
- 34861 jae disable_8 ! disable irq >= 8 at the slave 8259
- 34862 disable_0:
- 34863 inb INT_CTLMASK
- 34864 testb al, ah
- 34865 jnz dis_already ! already disabled?
- 34866 orb al, ah
- 34867 outb INT_CTLMASK ! set bit at master 8259
- 34868 popf
- 34869 mov ax, #1 ! disabled by this function
- 34870 ret
- 34871 disable_8:
- 34872 inb INT2_CTLMASK
- 34873 testb al, ah
- 34874 jnz dis_already ! already disabled?
- 34875 orb al, ah
- 34876 outb INT2_CTLMASK ! set bit at slave 8259
- 34877 popf
- 34878 mov ax, #1 ! disabled by this function
- 34879 ret
- 34880 dis_already:
- 34881 popf
- 34882 xor ax, ax ! already disabled
- 34883 ret
- 34884
- 34885
- 34886 !*===========================================================================*
- 34887 !* phys_copy *
- 34888 !*===========================================================================*
- 34889 ! PUBLIC void phys_copy(phys_bytes source, phys_bytes destination,
- 34890 ! phys_bytes bytecount);
- 34891 ! Copy a block of physical memory.
- 34892
- 34893 SRCLO = 4
- 34894 SRCHI = 6
- 34895 DESTLO = 8
- 34896 DESTHI = 10
- 34897 COUNTLO = 12
- 34898 COUNTHI = 14
- 34899
- 34900 _phys_copy:
- 34901 push bp ! save only registers required by C
- 34902 mov bp,sp ! set bp to point to source arg less 4
- 34903
- 34904 push si ! save si
- 34905 push di ! save di
- 34906 push ds ! save ds
- 34907 push es ! save es
- 34908
- 34909 mov ax,SRCLO(bp) ! dx:ax = source address (dx is NOT segment)
- 34910 mov dx,SRCHI(bp)
- 34911 mov si,ax ! si = source offset = address % 16
- 34912 and si,#OFF_MASK
- 34913 andb dl,#HCHIGH_MASK ! ds = source segment = address / 16 % 0x10000
- 34914 andb al,#HCLOW_MASK
- 34915 orb al,dl ! now bottom 4 bits of dx are in ax
- 34916 movb cl,#HCLICK_SHIFT ! rotate them to the top 4
- 34917 ror ax,cl
- 34918 mov ds,ax
- 34919
- 34920 mov ax,DESTLO(bp) ! dx:ax = destination addr (dx is NOT segment)
- 34921 mov dx,DESTHI(bp)
- 34922 mov di,ax ! di = dest offset = address % 16
- 34923 and di,#OFF_MASK
- 34924 andb dl,#HCHIGH_MASK ! es = dest segment = address / 16 % 0x10000
- 34925 andb al,#HCLOW_MASK
- 34926 orb al,dl
- 34927 ror ax,cl
- 34928 mov es,ax
- 34929
- 34930 mov ax,COUNTLO(bp) ! dx:ax = remaining count
- 34931 mov dx,COUNTHI(bp)
- 34932
- 34933 ! copy upwards (cannot handle overlapped copy)
- 34934
- 34935 pc_loop:
- 34936 mov cx,ax ! provisional count for this iteration
- 34937 test ax,ax ! if count >= 0x8000, only do 0x8000 per iter
- 34938 js pc_bigcount ! low byte already >= 0x8000
- 34939 test dx,dx
- 34940 jz pc_upcount ! less than 0x8000
- 34941 pc_bigcount:
- 34942 mov cx,#0x8000 ! use maximum count per iteration
- 34943 pc_upcount:
- 34944 sub ax,cx ! update count
- 34945 sbb dx,#0 ! cannot underflow, so carry clear now for rcr
- 34946 rcr cx,#1 ! count in words, carry remembers if byte
- 34947 jnb pc_even ! no odd byte
- 34948 movb ! copy odd byte
- 34949 pc_even:
- 34950 rep ! copy 1 word at a time
- 34951 movs ! word copy
- 34952
- 34953 mov cx,ax ! test if remaining count is 0
- 34954 or cx,dx
- 34955 jnz pc_more ! more to do
- 34956
- 34957 pop es ! restore es
- 34958 pop ds ! restore ds
- 34959 pop di ! restore di
- 34960 pop si ! restore si
- 34961 pop bp ! restore bp
- 34962 ret ! return to caller
- 34963
- 34964 pc_more:
- 34965 sub si,#0x8000 ! adjust pointers so the offset does not
- 34966 mov cx,ds ! overflow in the next 0x8000 bytes
- 34967 add cx,#0x800 ! pointers end up same physical location
- 34968 mov ds,cx ! the current offsets are known >= 0x8000
- 34969 sub di,#0x8000 ! since we just copied that many
- 34970 mov cx,es
- 34971 add cx,#0x800
- 34972 mov es,cx
- 34973 jmp pc_loop ! start next iteration
- 34974
- 34975
- 34976 !*===========================================================================*
- 34977 !* mem_rdw *
- 34978 !*===========================================================================*
- 34979 ! PUBLIC u16_t mem_rdw(u16_t segment, u16_t *offset);
- 34980 ! Load and return the word at the far pointer segment:offset.
- 34981
- 34982 _mem_rdw:
- 34983 mov cx,ds ! save ds
- 34984 pop dx ! return adr
- 34985 pop ds ! segment
- 34986 pop bx ! offset
- 34987 sub sp,#2+2 ! adjust for parameters popped
- 34988 mov ax,(bx) ! load the word to return
- 34989 mov ds,cx ! restore ds
- 34990 jmp (dx) ! return
- 34991
- 34992
- 34993 !*===========================================================================*
- 34994 !* reset *
- 34995 !*===========================================================================*
- 34996 ! PUBLIC void reset();
- 34997 ! Reset the system.
- 34998 ! In real mode we simply jump to the reset address.
- 34999
- 35000 _reset:
- 35001 jmpf 0,0xFFFF
- 35002
- 35003
- 35004 !*===========================================================================*
- 35005 !* mem_vid_copy *
- 35006 !*===========================================================================*
- 35007 ! PUBLIC void mem_vid_copy(u16 *src, unsigned dst, unsigned count);
- 35008 !
- 35009 ! Copy count characters from kernel memory to video memory. Src, dst and
- 35010 ! count are character (word) based video offsets and counts. If src is null
- 35011 ! then screen memory is blanked by filling it with blank_color.
- 35012
- 35013 MVC_ARGS = 2 + 2 + 2 + 2 ! 2 + 2 + 2
- 35014 ! es di si ip src dst ct
- 35015
- 35016 _mem_vid_copy:
- 35017 push si
- 35018 push di
- 35019 push es
- 35020 mov bx, sp
- 35021 mov si, MVC_ARGS(bx) ! source
- 35022 mov di, MVC_ARGS+2(bx) ! destination
- 35023 mov dx, MVC_ARGS+2+2(bx) ! count
- 35024 mov es, _vid_seg ! destination is video segment
- 35025 cld ! make sure direction is up
- 35026 mvc_loop:
- 35027 and di, _vid_mask ! wrap address
- 35028 mov cx, dx ! one chunk to copy
- 35029 mov ax, _vid_size
- 35030 sub ax, di
- 35031 cmp cx, ax
- 35032 jbe 0f
- 35033 mov cx, ax ! cx = min(cx, vid_size - di)
- 35034 0: sub dx, cx ! count -= cx
- 35035 shl di, #1 ! byte address
- 35036 test si, si ! source == 0 means blank the screen
- 35037 jz mvc_blank
- 35038 mvc_copy:
- 35039 rep ! copy words to video memory
- 35040 movs
- 35041 jmp mvc_test
- 35042 mvc_blank:
- 35043 mov ax, _blank_color ! ax = blanking character
- 35044 rep
- 35045 stos ! copy blanks to video memory
- 35046 !jmp mvc_test
- 35047 mvc_test:
- 35048 shr di, #1 ! word addresses
- 35049 test dx, dx
- 35050 jnz mvc_loop
- 35051 mvc_done:
- 35052 pop es
- 35053 pop di
- 35054 pop si
- 35055 ret
- 35056
- 35057
- 35058 !*===========================================================================*
- 35059 !* vid_vid_copy *
- 35060 !*===========================================================================*
- 35061 ! PUBLIC void vid_vid_copy(unsigned src, unsigned dst, unsigned count);
- 35062 !
- 35063 ! Copy count characters from video memory to video memory. Handle overlap.
- 35064 ! Used for scrolling, line or character insertion and deletion. Src, dst
- 35065 ! and count are character (word) based video offsets and counts.
- 35066
- 35067 VVC_ARGS = 2 + 2 + 2 + 2 ! 2 + 2 + 2
- 35068 ! es di si ip src dst ct
- 35069
- 35070 _vid_vid_copy:
- 35071 push si
- 35072 push di
- 35073 push es
- 35074 mov bx, sp
- 35075 mov si, VVC_ARGS(bx) ! source
- 35076 mov di, VVC_ARGS+2(bx) ! destination
- 35077 mov dx, VVC_ARGS+2+2(bx) ! count
- 35078 mov es, _vid_seg ! use video segment
- 35079 cmp si, di ! copy up or down?
- 35080 jb vvc_down
- 35081 vvc_up:
- 35082 cld ! direction is up
- 35083 vvc_uploop:
- 35084 and si, _vid_mask ! wrap addresses
- 35085 and di, _vid_mask
- 35086 mov cx, dx ! one chunk to copy
- 35087 mov ax, _vid_size
- 35088 sub ax, si
- 35089 cmp cx, ax
- 35090 jbe 0f
- 35091 mov cx, ax ! cx = min(cx, vid_size - si)
- 35092 0: mov ax, _vid_size
- 35093 sub ax, di
- 35094 cmp cx, ax
- 35095 jbe 0f
- 35096 mov cx, ax ! cx = min(cx, vid_size - di)
- 35097 0: sub dx, cx ! count -= cx
- 35098 shl si, #1
- 35099 shl di, #1 ! byte addresses
- 35100 rep
- 35101 eseg movs ! copy video words
- 35102 shr si, #1
- 35103 shr di, #1 ! word addresses
- 35104 test dx, dx
- 35105 jnz vvc_uploop ! again?
- 35106 jmp vvc_done
- 35107 vvc_down:
- 35108 std ! direction is down
- 35109 add si, dx ! start copying at the top
- 35110 dec si
- 35111 add di, dx
- 35112 dec di
- 35113 vvc_downloop:
- 35114 and si, _vid_mask ! wrap addresses
- 35115 and di, _vid_mask
- 35116 mov cx, dx ! one chunk to copy
- 35117 lea ax, 1(si)
- 35118 cmp cx, ax
- 35119 jbe 0f
- 35120 mov cx, ax ! cx = min(cx, si + 1)
- 35121 0: lea ax, 1(di)
- 35122 cmp cx, ax
- 35123 jbe 0f
- 35124 mov cx, ax ! cx = min(cx, di + 1)
- 35125 0: sub dx, cx ! count -= cx
- 35126 shl si, #1
- 35127 shl di, #1 ! byte addresses
- 35128 rep
- 35129 eseg movs ! copy video words
- 35130 shr si, #1
- 35131 shr di, #1 ! word addresses
- 35132 test dx, dx
- 35133 jnz vvc_downloop ! again?
- 35134 cld ! C compiler expect up
- 35135 !jmp vvc_done
- 35136 vvc_done:
- 35137 pop es
- 35138 pop di
- 35139 pop si
- 35140 ret
- 35141
- 35142
- 35143 !*===========================================================================*
- 35144 !* level0 *
- 35145 !*===========================================================================*
- 35146 ! PUBLIC void level0(void (*func)(void))
- 35147 ! Not very interesting in real mode, see p_level0.
- 35148 !
- 35149 _level0:
- 35150 mov bx, sp
- 35151 jmp @2(bx)
- 35152
- 35153
- 35154 !*===========================================================================*
- 35155 !* klib_init_prot *
- 35156 !*===========================================================================*
- 35157 ! PUBLIC void klib_init_prot();
- 35158 ! Initialize klib for protected mode by patching some real mode functions
- 35159 ! at their starts to jump to their protected mode equivalents, according to
- 35160 ! the patch table. Saves a lot of tests on the "protected_mode" variable.
- 35161 ! Note that this function must be run in real mode, for it writes the code
- 35162 ! segment. (One otherwise has to set up a descriptor, etc, etc.)
- 35163
- 35164 klib_init_prot:
- 35165 mov si,#patch_table
- 35166 kip_next:
- 35167 lods ! original function
- 35168 mov bx,ax
- 35169 cseg movb (bx),#JMP_OPCODE ! overwrite start of function by a long jump
- 35170 lods ! new function - target of jump
- 35171 sub ax,bx ! relative jump
- 35172 sub ax,#3 ! adjust by length of jump instruction
- 35173 cseg mov 1(bx),ax ! set address
- 35174 cmp si,#end_patch_table ! end of table?
- 35175 jb kip_next
- 35176 kip_done:
- 35177 ret
- 35178
- 35179
- 35180 !*===========================================================================*
- 35181 !* variants for protected mode *
- 35182 !*===========================================================================*
- 35183 ! Some routines are different in protected mode.
- 35184 ! The only essential difference is the handling of segment registers.
- 35185 ! One complication is that the method of building segment descriptors is not
- 35186 ! reentrant, so the protected mode versions must not be called by interrupt
- 35187 ! handlers.
- 35188
- 35189
- 35190 !*===========================================================================*
- 35191 !* p_cp_mess *
- 35192 !*===========================================================================*
- 35193 ! The real mode version attempts to be efficient by passing raw segments but
- 35194 ! that just gets in the way here.
- 35195
- 35196 p_cp_mess:
- 35197 cld
- 35198 pop dx
- 35199 pop bx ! proc
- 35200 pop cx ! source clicks
- 35201 pop ax ! source offset
- 35202 #if CLICK_SHIFT != HCLICK_SHIFT + 4
- 35203 #error /* the only click size supported is 256, to avoid slow shifts here */
- 35204 #endif
- 35205 addb ah,cl ! calculate source offset
- 35206 adcb ch,#0 ! and put in base of source descriptor
- 35207 mov _gdt+DS_286_OFFSET+DESC_BASE,ax
- 35208 movb _gdt+DS_286_OFFSET+DESC_BASE_MIDDLE,ch
- 35209 pop cx ! destination clicks
- 35210 pop ax ! destination offset
- 35211 addb ah,cl ! calculate destination offset
- 35212 adcb ch,#0 ! and put in base of destination descriptor
- 35213 mov _gdt+ES_286_OFFSET+DESC_BASE,ax
- 35214 movb _gdt+ES_286_OFFSET+DESC_BASE_MIDDLE,ch
- 35215 sub sp,#2+2+2+2+2
- 35216
- 35217 push ds
- 35218 push es
- 35219 mov ax,#DS_286_SELECTOR
- 35220 mov ds,ax
- 35221 mov ax,#ES_286_SELECTOR
- 35222 mov es,ax
- 35223
- 35224 eseg mov 0,bx ! proc no. of sender from arg, not msg
- 35225 mov ax,si
- 35226 mov bx,di
- 35227 mov si,#2 ! src offset is now 2 relative to start of seg
- 35228 mov di,si ! and destination offset
- 35229 mov cx,#Msize-1 ! word count
- 35230 rep
- 35231 movs
- 35232 mov di,bx
- 35233 mov si,ax
- 35234 pop es
- 35235 pop ds
- 35236 jmp (dx)
- 35237
- 35238
- 35239 !*===========================================================================*
- 35240 !* p_portio_setup *
- 35241 !*===========================================================================*
- 35242 ! The port_read, port_write, etc. functions need a setup routine that uses
- 35243 ! a segment descriptor.
- 35244 p_portio_setup:
- 35245 mov ax,4+2(bp) ! source/destination address in dx:ax
- 35246 mov dx,4+2+2(bp)
- 35247 mov _gdt+DS_286_OFFSET+DESC_BASE,ax
- 35248 movb _gdt+DS_286_OFFSET+DESC_BASE_MIDDLE,dl
- 35249 xor bx,bx ! bx = 0 = start of segment
- 35250 mov ax,#DS_286_SELECTOR ! ax = segment selector
- 35251 mov cx,4+2+4(bp) ! count in bytes
- 35252 mov dx,4(bp) ! port to read from
- 35253 cld ! direction is UP
- 35254 ret
- 35255
- 35256
- 35257 !*===========================================================================*
- 35258 !* p_phys_copy *
- 35259 !*===========================================================================*
- 35260 p_phys_copy:
- 35261 cld
- 35262 pop dx
- 35263 pop _gdt+DS_286_OFFSET+DESC_BASE
- 35264 pop ax ! pop source into base of source descriptor
- 35265 movb _gdt+DS_286_OFFSET+DESC_BASE_MIDDLE,al
- 35266 pop _gdt+ES_286_OFFSET+DESC_BASE
- 35267 pop ax ! pop destination into base of dst descriptor
- 35268 movb _gdt+ES_286_OFFSET+DESC_BASE_MIDDLE,al
- 35269 pop cx ! byte count in bx:cx
- 35270 pop bx
- 35271 sub sp,#4+4+4
- 35272
- 35273 push di
- 35274 push si
- 35275 push es
- 35276 push ds
- 35277 sub si,si ! src offset is now 0 relative to start of seg
- 35278 mov di,si ! and destination offset
- 35279 jmp ppc_next
- 35280
- 35281 ! It is too much trouble to align the segment bases, so word alignment is hard.
- 35282 ! Avoiding the book-keeping for alignment may be good anyway.
- 35283
- 35284 ppc_large:
- 35285 push cx
- 35286 mov cx,#0x8000 ! copy a large chunk of this many words
- 35287 rep
- 35288 movs
- 35289 pop cx
- 35290 dec bx
- 35291 pop ds ! update the descriptors
- 35292 incb _gdt+DS_286_OFFSET+DESC_BASE_MIDDLE
- 35293 incb _gdt+ES_286_OFFSET+DESC_BASE_MIDDLE
- 35294 push ds
- 35295 ppc_next:
- 35296 mov ax,#DS_286_SELECTOR ! (re)load the selectors
- 35297 mov ds,ax
- 35298 mov ax,#ES_286_SELECTOR
- 35299 mov es,ax
- 35300 test bx,bx
- 35301 jnz ppc_large
- 35302
- 35303 shr cx,#1 ! word count
- 35304 rep
- 35305 movs ! move any leftover words
- 35306 rcl cx,#1 ! restore old bit 0
- 35307 rep
- 35308 movb ! move any leftover byte
- 35309 pop ds
- 35310 pop es
- 35311 pop si
- 35312 pop di
- 35313 jmp (dx)
- 35314
- 35315 !*===========================================================================*
- 35316 !* p_reset *
- 35317 !*===========================================================================*
- 35318 ! Reset the system by loading IDT with offset 0 and interrupting.
- 35319
- 35320 p_reset:
- 35321 lidt idt_zero
- 35322 int 3 ! anything goes, the 286 will not like it
- 35323
- 35324
- 35325 !*===========================================================================*
- 35326 !* p_level0 *
- 35327 !*===========================================================================*
- 35328 ! PUBLIC void level0(void (*func)(void))
- 35329 ! Call a function at permission level 0. This allows kernel tasks to do
- 35330 ! things that are only possible at the most privileged CPU level.
- 35331 !
- 35332 p_level0:
- 35333 mov bx, sp
- 35334 mov ax, 2(bx)
- 35335 mov _level0_func, ax
- 35336 int LEVEL0_VECTOR
- 35337 ret
- 35338
- 35339
- 35340 !*===========================================================================*
- 35341 !* data *
- 35342 !*===========================================================================*
- 35343 .data
- 35344 patch_table: ! pairs (old function, new function)
- 35345 #if ENABLE_BIOS_WINI
- 35346 .data2 _bios13, p_bios13
- 35347 #endif
- 35348 .data2 _cp_mess, p_cp_mess
- 35349 .data2 _phys_copy, p_phys_copy
- 35350 .data2 portio_setup, p_portio_setup
- 35351 .data2 _reset, p_reset
- 35352 .data2 _level0, p_level0
- 35353 .data2 _restart, p_restart ! in mpx file
- 35354 .data2 save, p_save ! in mpx file
- 35355 end_patch_table: ! end of table
- 35356
- 35357 idt_vectors: ! limit and base of real mode interrupt vectors
- 35358 .data2 0x3FF
- 35359 idt_zero: ! zero limit IDT to cause a processor shutdown
- 35360 .data2 0, 0, 0
- 35361
- 35362 .bss
- 35363 save_sp: ! place to put sp when switching to real mode
- 35364 .space 2
- 35365 msw: ! saved real mode machine status word
- 35366 .space 2
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/mpx.s
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 35400 #
- 35401 ! Chooses between the 8086 and 386 versions of the Minix startup code.
- 35402
- 35403 #include <minix/config.h>
- 35404 #if _WORD_SIZE == 2
- 35405 #include "mpx88.s"
- 35406 #else
- 35407 #include "mpx386.s"
- 35408 #endif
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/mpx386.s
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 35500 #
- 35501 ! This file contains the assembler startup code for Minix and the 32-bit
- 35502 ! interrupt handlers. It cooperates with start.c to set up a good
- 35503 ! environment for main().
- 35504
- 35505 ! This file is part of the lowest layer of the MINIX kernel. The other part
- 35506 ! is "proc.c". The lowest layer does process switching and message handling.
- 35507
- 35508 ! Every transition to the kernel goes through this file. Transitions are
- 35509 ! caused by sending/receiving messages and by most interrupts. (RS232
- 35510 ! interrupts may be handled in the file "rs2.s" and then they rarely enter
- 35511 ! the kernel.)
- 35512
- 35513 ! Transitions to the kernel may be nested. The initial entry may be with a
- 35514 ! system call, exception or hardware interrupt; reentries may only be made
- 35515 ! by hardware interrupts. The count of reentries is kept in "k_reenter".
- 35516 ! It is important for deciding whether to switch to the kernel stack and
- 35517 ! for protecting the message passing code in "proc.c".
- 35518
- 35519 ! For the message passing trap, most of the machine state is saved in the
- 35520 ! proc table. (Some of the registers need not be saved.) Then the stack is
- 35521 ! switched to "k_stack", and interrupts are reenabled. Finally, the system
- 35522 ! call handler (in C) is called. When it returns, interrupts are disabled
- 35523 ! again and the code falls into the restart routine, to finish off held-up
- 35524 ! interrupts and run the process or task whose pointer is in "proc_ptr".
- 35525
- 35526 ! Hardware interrupt handlers do the same, except (1) The entire state must
- 35527 ! be saved. (2) There are too many handlers to do this inline, so the save
- 35528 ! routine is called. A few cycles are saved by pushing the address of the
- 35529 ! appropiate restart routine for a return later. (3) A stack switch is
- 35530 ! avoided when the stack is already switched. (4) The (master) 8259 interrupt
- 35531 ! controller is reenabled centrally in save(). (5) Each interrupt handler
- 35532 ! masks its interrupt line using the 8259 before enabling (other unmasked)
- 35533 ! interrupts, and unmasks it after servicing the interrupt. This limits the
- 35534 ! nest level to the number of lines and protects the handler from itself.
- 35535
- 35536 ! For communication with the boot monitor at startup time some constant
- 35537 ! data are compiled into the beginning of the text segment. This facilitates
- 35538 ! reading the data at the start of the boot process, since only the first
- 35539 ! sector of the file needs to be read.
- 35540
- 35541 ! Some data storage is also allocated at the end of this file. This data
- 35542 ! will be at the start of the data segment of the kernel and will be read
- 35543 ! and modified by the boot monitor before the kernel starts.
- 35544
- 35545 ! sections
- 35546
- 35547 .sect .text
- 35548 begtext:
- 35549 .sect .rom
- 35550 begrom:
- 35551 .sect .data
- 35552 begdata:
- 35553 .sect .bss
- 35554 begbss:
- 35555
- 35556 #include <minix/config.h>
- 35557 #include <minix/const.h>
- 35558 #include <minix/com.h>
- 35559 #include "const.h"
- 35560 #include "protect.h"
- 35561 #include "sconst.h"
- 35562
- 35563 /* Selected 386 tss offsets. */
- 35564 #define TSS3_S_SP0 4
- 35565
- 35566 ! Exported functions
- 35567 ! Note: in assembly language the .define statement applied to a function name
- 35568 ! is loosely equivalent to a prototype in C code -- it makes it possible to
- 35569 ! link to an entity declared in the assembly code but does not create
- 35570 ! the entity.
- 35571
- 35572 .define _idle_task
- 35573 .define _restart
- 35574 .define save
- 35575
- 35576 .define _divide_error
- 35577 .define _single_step_exception
- 35578 .define _nmi
- 35579 .define _breakpoint_exception
- 35580 .define _overflow
- 35581 .define _bounds_check
- 35582 .define _inval_opcode
- 35583 .define _copr_not_available
- 35584 .define _double_fault
- 35585 .define _copr_seg_overrun
- 35586 .define _inval_tss
- 35587 .define _segment_not_present
- 35588 .define _stack_exception
- 35589 .define _general_protection
- 35590 .define _page_fault
- 35591 .define _copr_error
- 35592
- 35593 .define _hwint00 ! handlers for hardware interrupts
- 35594 .define _hwint01
- 35595 .define _hwint02
- 35596 .define _hwint03
- 35597 .define _hwint04
- 35598 .define _hwint05
- 35599 .define _hwint06
- 35600 .define _hwint07
- 35601 .define _hwint08
- 35602 .define _hwint09
- 35603 .define _hwint10
- 35604 .define _hwint11
- 35605 .define _hwint12
- 35606 .define _hwint13
- 35607 .define _hwint14
- 35608 .define _hwint15
- 35609
- 35610 .define _s_call
- 35611 .define _p_s_call
- 35612 .define _level0_call
- 35613
- 35614 ! Imported functions.
- 35615
- 35616 .extern _cstart
- 35617 .extern _main
- 35618 .extern _exception
- 35619 .extern _interrupt
- 35620 .extern _sys_call
- 35621 .extern _unhold
- 35622
- 35623 ! Exported variables.
- 35624 ! Note: when used with a variable the .define does not reserve storage,
- 35625 ! it makes the name externally visible so it may be linked to.
- 35626
- 35627 .define begbss
- 35628 .define begdata
- 35629 .define _sizes
- 35630
- 35631 ! Imported variables.
- 35632
- 35633 .extern _gdt
- 35634 .extern _code_base
- 35635 .extern _data_base
- 35636 .extern _held_head
- 35637 .extern _k_reenter
- 35638 .extern _pc_at
- 35639 .extern _proc_ptr
- 35640 .extern _ps_mca
- 35641 .extern _tss
- 35642 .extern _level0_func
- 35643 .extern _mon_sp
- 35644 .extern _mon_return
- 35645 .extern _reboot_code
- 35646
- 35647 .sect .text
- 35648 !*===========================================================================*
- 35649 !* MINIX *
- 35650 !*===========================================================================*
- 35651 MINIX: ! this is the entry point for the MINIX kernel
- 35652 jmp over_flags ! skip over the next few bytes
- 35653 .data2 CLICK_SHIFT ! for the monitor: memory granularity
- 35654 flags:
- 35655 .data2 0x002D ! boot monitor flags:
- 35656 ! call in 386 mode, make stack,
- 35657 ! load high, will return
- 35658 nop ! extra byte to sync up disassembler
- 35659 over_flags:
- 35660
- 35661 ! Set up a C stack frame on the monitor stack. (The monitor sets cs and ds
- 35662 ! right. The ss descriptor still references the monitor data segment.)
- 35663 movzx esp, sp ! monitor stack is a 16 bit stack
- 35664 push ebp
- 35665 mov ebp, esp
- 35666 push esi
- 35667 push edi
- 35668 cmp 4(ebp), 0 ! nonzero if return possible
- 35669 jz noret
- 35670 inc (_mon_return)
- 35671 noret: mov (_mon_sp), esp ! save stack pointer for later return
- 35672
- 35673 ! Copy the monitor global descriptor table to the address space of kernel and
- 35674 ! switch over to it. Prot_init() can then update it with immediate effect.
- 35675
- 35676 sgdt (_gdt+GDT_SELECTOR) ! get the monitor gdtr
- 35677 mov esi, (_gdt+GDT_SELECTOR+2) ! absolute address of GDT
- 35678 mov ebx, _gdt ! address of kernel GDT
- 35679 mov ecx, 8*8 ! copying eight descriptors
- 35680 copygdt:
- 35681 eseg movb al, (esi)
- 35682 movb (ebx), al
- 35683 inc esi
- 35684 inc ebx
- 35685 loop copygdt
- 35686 mov eax, (_gdt+DS_SELECTOR+2) ! base of kernel data
- 35687 and eax, 0x00FFFFFF ! only 24 bits
- 35688 add eax, _gdt ! eax = vir2phys(gdt)
- 35689 mov (_gdt+GDT_SELECTOR+2), eax ! set base of GDT
- 35690 lgdt (_gdt+GDT_SELECTOR) ! switch over to kernel GDT
- 35691
- 35692 ! Locate boot parameters, set up kernel segment registers and stack.
- 35693 mov ebx, 8(ebp) ! boot parameters offset
- 35694 mov edx, 12(ebp) ! boot parameters length
- 35695 mov ax, ds ! kernel data
- 35696 mov es, ax
- 35697 mov fs, ax
- 35698 mov gs, ax
- 35699 mov ss, ax
- 35700 mov esp, k_stktop ! set sp to point to the top of kernel stack
- 35701
- 35702 ! Call C startup code to set up a proper environment to run main().
- 35703 push edx
- 35704 push ebx
- 35705 push SS_SELECTOR
- 35706 push MON_CS_SELECTOR
- 35707 push DS_SELECTOR
- 35708 push CS_SELECTOR
- 35709 call _cstart ! cstart(cs, ds, mcs, mds, parmoff, parmlen)
- 35710 add esp, 6*4
- 35711
- 35712 ! Reload gdtr, idtr and the segment registers to global descriptor table set
- 35713 ! up by prot_init().
- 35714
- 35715 lgdt (_gdt+GDT_SELECTOR)
- 35716 lidt (_gdt+IDT_SELECTOR)
- 35717
- 35718 jmpf CS_SELECTOR:csinit
- 35719 csinit:
- 35720 o16 mov ax, DS_SELECTOR
- 35721 mov ds, ax
- 35722 mov es, ax
- 35723 mov fs, ax
- 35724 mov gs, ax
- 35725 mov ss, ax
- 35726 o16 mov ax, TSS_SELECTOR ! no other TSS is used
- 35727 ltr ax
- 35728 push 0 ! set flags to known good state
- 35729 popf ! esp, clear nested task and int enable
- 35730
- 35731 jmp _main ! main()
- 35732
- 35733
- 35734 !*===========================================================================*
- 35735 !* interrupt handlers *
- 35736 !* interrupt handlers for 386 32-bit protected mode *
- 35737 !*===========================================================================*
- 35738
- 35739 !*===========================================================================*
- 35740 !* hwint00 - 07 *
- 35741 !*===========================================================================*
- 35742 ! Note this is a macro, it looks like a subroutine.
- 35743 #define hwint_master(irq)
- 35744 call save /* save interrupted process state */;
- 35745 inb INT_CTLMASK ;
- 35746 orb al, [1<<irq] ;
- 35747 outb INT_CTLMASK /* disable the irq */;
- 35748 movb al, ENABLE ;
- 35749 outb INT_CTL /* reenable master 8259 */;
- 35750 sti /* enable interrupts */;
- 35751 push irq /* irq */;
- 35752 call (_irq_table + 4*irq) /* eax = (*irq_table[irq])(irq) */;
- 35753 pop ecx ;
- 35754 cli /* disable interrupts */;
- 35755 test eax, eax /* need to reenable irq? */;
- 35756 jz 0f ;
- 35757 inb INT_CTLMASK ;
- 35758 andb al, ~[1<<irq] ;
- 35759 outb INT_CTLMASK /* enable the irq */;
- 35760 0: ret /* restart (another) process */
- 35761
- 35762 ! Each of these entry points is an expansion of the hwint_master macro
- 35763 .align 16
- 35764 _hwint00: ! Interrupt routine for irq 0 (the clock).
- 35765 hwint_master(0)
- 35766
- 35767 .align 16
- 35768 _hwint01: ! Interrupt routine for irq 1 (keyboard)
- 35769 hwint_master(1)
- 35770
- 35771 .align 16
- 35772 _hwint02: ! Interrupt routine for irq 2 (cascade!)
- 35773 hwint_master(2)
- 35774
- 35775 .align 16
- 35776 _hwint03: ! Interrupt routine for irq 3 (second serial)
- 35777 hwint_master(3)
- 35778
- 35779 .align 16
- 35780 _hwint04: ! Interrupt routine for irq 4 (first serial)
- 35781 hwint_master(4)
- 35782
- 35783 .align 16
- 35784 _hwint05: ! Interrupt routine for irq 5 (XT winchester)
- 35785 hwint_master(5)
- 35786
- 35787 .align 16
- 35788 _hwint06: ! Interrupt routine for irq 6 (floppy)
- 35789 hwint_master(6)
- 35790
- 35791 .align 16
- 35792 _hwint07: ! Interrupt routine for irq 7 (printer)
- 35793 hwint_master(7)
- 35794
- 35795 !*===========================================================================*
- 35796 !* hwint08 - 15 *
- 35797 !*===========================================================================*
- 35798 ! Note this is a macro, it looks like a subroutine.
- 35799 #define hwint_slave(irq)
- 35800 call save /* save interrupted process state */;
- 35801 inb INT2_CTLMASK ;
- 35802 orb al, [1<<[irq-8]] ;
- 35803 outb INT2_CTLMASK /* disable the irq */;
- 35804 movb al, ENABLE ;
- 35805 outb INT_CTL /* reenable master 8259 */;
- 35806 jmp .+2 /* delay */;
- 35807 outb INT2_CTL /* reenable slave 8259 */;
- 35808 sti /* enable interrupts */;
- 35809 push irq /* irq */;
- 35810 call (_irq_table + 4*irq) /* eax = (*irq_table[irq])(irq) */;
- 35811 pop ecx ;
- 35812 cli /* disable interrupts */;
- 35813 test eax, eax /* need to reenable irq? */;
- 35814 jz 0f ;
- 35815 inb INT2_CTLMASK ;
- 35816 andb al, ~[1<<[irq-8]] ;
- 35817 outb INT2_CTLMASK /* enable the irq */;
- 35818 0: ret /* restart (another) process */
- 35819
- 35820 ! Each of these entry points is an expansion of the hwint_slave macro
- 35821 .align 16
- 35822 _hwint08: ! Interrupt routine for irq 8 (realtime clock)
- 35823 hwint_slave(8)
- 35824
- 35825 .align 16
- 35826 _hwint09: ! Interrupt routine for irq 9 (irq 2 redirected)
- 35827 hwint_slave(9)
- 35828
- 35829 .align 16
- 35830 _hwint10: ! Interrupt routine for irq 10
- 35831 hwint_slave(10)
- 35832
- 35833 .align 16
- 35834 _hwint11: ! Interrupt routine for irq 11
- 35835 hwint_slave(11)
- 35836
- 35837 .align 16
- 35838 _hwint12: ! Interrupt routine for irq 12
- 35839 hwint_slave(12)
- 35840
- 35841 .align 16
- 35842 _hwint13: ! Interrupt routine for irq 13 (FPU exception)
- 35843 hwint_slave(13)
- 35844
- 35845 .align 16
- 35846 _hwint14: ! Interrupt routine for irq 14 (AT winchester)
- 35847 hwint_slave(14)
- 35848
- 35849 .align 16
- 35850 _hwint15: ! Interrupt routine for irq 15
- 35851 hwint_slave(15)
- 35852
- 35853 !*===========================================================================*
- 35854 !* save *
- 35855 !*===========================================================================*
- 35856 ! Save for protected mode.
- 35857 ! This is much simpler than for 8086 mode, because the stack already points
- 35858 ! into the process table, or has already been switched to the kernel stack.
- 35859
- 35860 .align 16
- 35861 save:
- 35862 cld ! set direction flag to a known value
- 35863 pushad ! save "general" registers
- 35864 o16 push ds ! save ds
- 35865 o16 push es ! save es
- 35866 o16 push fs ! save fs
- 35867 o16 push gs ! save gs
- 35868 mov dx, ss ! ss is kernel data segment
- 35869 mov ds, dx ! load rest of kernel segments
- 35870 mov es, dx ! kernel does not use fs, gs
- 35871 mov eax, esp ! prepare to return
- 35872 incb (_k_reenter) ! from -1 if not reentering
- 35873 jnz set_restart1 ! stack is already kernel stack
- 35874 mov esp, k_stktop
- 35875 push _restart ! build return address for int handler
- 35876 xor ebp, ebp ! for stacktrace
- 35877 jmp RETADR-P_STACKBASE(eax)
- 35878
- 35879 .align 4
- 35880 set_restart1:
- 35881 push restart1
- 35882 jmp RETADR-P_STACKBASE(eax)
- 35883
- 35884 !*===========================================================================*
- 35885 !* _s_call *
- 35886 !*===========================================================================*
- 35887 .align 16
- 35888 _s_call:
- 35889 _p_s_call:
- 35890 cld ! set direction flag to a known value
- 35891 sub esp, 6*4 ! skip RETADR, eax, ecx, edx, ebx, est
- 35892 push ebp ! stack already points into proc table
- 35893 push esi
- 35894 push edi
- 35895 o16 push ds
- 35896 o16 push es
- 35897 o16 push fs
- 35898 o16 push gs
- 35899 mov dx, ss
- 35900 mov ds, dx
- 35901 mov es, dx
- 35902 incb (_k_reenter)
- 35903 mov esi, esp ! assumes P_STACKBASE == 0
- 35904 mov esp, k_stktop
- 35905 xor ebp, ebp ! for stacktrace
- 35906 ! end of inline save
- 35907 sti ! allow SWITCHER to be interrupted
- 35908 ! now set up parameters for sys_call()
- 35909 push ebx ! pointer to user message
- 35910 push eax ! src/dest
- 35911 push ecx ! SEND/RECEIVE/BOTH
- 35912 call _sys_call ! sys_call(function, src_dest, m_ptr)
- 35913 ! caller is now explicitly in proc_ptr
- 35914 mov AXREG(esi), eax ! sys_call MUST PRESERVE si
- 35915 cli ! disable interrupts
- 35916
- 35917 ! Fall into code to restart proc/task running.
- 35918
- 35919 !*===========================================================================*
- 35920 !* restart *
- 35921 !*===========================================================================*
- 35922 _restart:
- 35923
- 35924 ! Flush any held-up interrupts.
- 35925 ! This reenables interrupts, so the current interrupt handler may reenter.
- 35926 ! This does not matter, because the current handler is about to exit and no
- 35927 ! other handlers can reenter since flushing is only done when k_reenter == 0.
- 35928
- 35929 cmp (_held_head), 0 ! do fast test to usually avoid function call
- 35930 jz over_call_unhold
- 35931 call _unhold ! this is rare so overhead acceptable
- 35932 over_call_unhold:
- 35933 mov esp, (_proc_ptr) ! will assume P_STACKBASE == 0
- 35934 lldt P_LDT_SEL(esp) ! enable segment descriptors for task
- 35935 lea eax, P_STACKTOP(esp) ! arrange for next interrupt
- 35936 mov (_tss+TSS3_S_SP0), eax ! to save state in process table
- 35937 restart1:
- 35938 decb (_k_reenter)
- 35939 o16 pop gs
- 35940 o16 pop fs
- 35941 o16 pop es
- 35942 o16 pop ds
- 35943 popad
- 35944 add esp, 4 ! skip return adr
- 35945 iretd ! continue process
- 35946
- 35947 !*===========================================================================*
- 35948 !* exception handlers *
- 35949 !*===========================================================================*
- 35950 _divide_error:
- 35951 push DIVIDE_VECTOR
- 35952 jmp exception
- 35953
- 35954 _single_step_exception:
- 35955 push DEBUG_VECTOR
- 35956 jmp exception
- 35957
- 35958 _nmi:
- 35959 push NMI_VECTOR
- 35960 jmp exception
- 35961
- 35962 _breakpoint_exception:
- 35963 push BREAKPOINT_VECTOR
- 35964 jmp exception
- 35965
- 35966 _overflow:
- 35967 push OVERFLOW_VECTOR
- 35968 jmp exception
- 35969
- 35970 _bounds_check:
- 35971 push BOUNDS_VECTOR
- 35972 jmp exception
- 35973
- 35974 _inval_opcode:
- 35975 push INVAL_OP_VECTOR
- 35976 jmp exception
- 35977
- 35978 _copr_not_available:
- 35979 push COPROC_NOT_VECTOR
- 35980 jmp exception
- 35981
- 35982 _double_fault:
- 35983 push DOUBLE_FAULT_VECTOR
- 35984 jmp errexception
- 35985
- 35986 _copr_seg_overrun:
- 35987 push COPROC_SEG_VECTOR
- 35988 jmp exception
- 35989
- 35990 _inval_tss:
- 35991 push INVAL_TSS_VECTOR
- 35992 jmp errexception
- 35993
- 35994 _segment_not_present:
- 35995 push SEG_NOT_VECTOR
- 35996 jmp errexception
- 35997
- 35998 _stack_exception:
- 35999 push STACK_FAULT_VECTOR
- 36000 jmp errexception
- 36001
- 36002 _general_protection:
- 36003 push PROTECTION_VECTOR
- 36004 jmp errexception
- 36005
- 36006 _page_fault:
- 36007 push PAGE_FAULT_VECTOR
- 36008 jmp errexception
- 36009
- 36010 _copr_error:
- 36011 push COPROC_ERR_VECTOR
- 36012 jmp exception
- 36013
- 36014 !*===========================================================================*
- 36015 !* exception *
- 36016 !*===========================================================================*
- 36017 ! This is called for all exceptions which do not push an error code.
- 36018
- 36019 .align 16
- 36020 exception:
- 36021 sseg mov (trap_errno), 0 ! clear trap_errno
- 36022 sseg pop (ex_number)
- 36023 jmp exception1
- 36024
- 36025 !*===========================================================================*
- 36026 !* errexception *
- 36027 !*===========================================================================*
- 36028 ! This is called for all exceptions which push an error code.
- 36029
- 36030 .align 16
- 36031 errexception:
- 36032 sseg pop (ex_number)
- 36033 sseg pop (trap_errno)
- 36034 exception1: ! Common for all exceptions.
- 36035 push eax ! eax is scratch register
- 36036 mov eax, 0+4(esp) ! old eip
- 36037 sseg mov (old_eip), eax
- 36038 movzx eax, 4+4(esp) ! old cs
- 36039 sseg mov (old_cs), eax
- 36040 mov eax, 8+4(esp) ! old eflags
- 36041 sseg mov (old_eflags), eax
- 36042 pop eax
- 36043 call save
- 36044 push (old_eflags)
- 36045 push (old_cs)
- 36046 push (old_eip)
- 36047 push (trap_errno)
- 36048 push (ex_number)
- 36049 call _exception ! (ex_number, trap_errno, old_eip,
- 36050 ! old_cs, old_eflags)
- 36051 add esp, 5*4
- 36052 cli
- 36053 ret
- 36054
- 36055 !*===========================================================================*
- 36056 !* level0_call *
- 36057 !*===========================================================================*
- 36058 _level0_call:
- 36059 call save
- 36060 jmp (_level0_func)
- 36061
- 36062 !*===========================================================================*
- 36063 !* idle_task *
- 36064 !*===========================================================================*
- 36065 _idle_task: ! executed when there is no work
- 36066 jmp _idle_task ! a "hlt" before this fails in protected mode
- 36067
- 36068 !*===========================================================================*
- 36069 !* data *
- 36070 !*===========================================================================*
- 36071 ! These declarations assure that storage will be allocated at the very
- 36072 ! beginning of the kernel data section, so the boot monitor can be easily
- 36073 ! told how to patch these locations. Note that the magic number is put
- 36074 ! here by the compiler, but will be read by, and then overwritten by,
- 36075 ! the boot monitor. When the kernel starts the sizes array will be
- 36076 ! found here, as if it had been initialized by the compiler.
- 36077
- 36078 .sect .rom ! Before the string table please
- 36079 _sizes: ! sizes of kernel, mm, fs filled in by boot
- 36080 .data2 0x526F ! this must be the first data entry (magic #)
- 36081 .space 16*2*2-2 ! monitor uses previous word and this space
- 36082 ! extra space allows for additional servers
- 36083 .sect .bss
- 36084 k_stack:
- 36085 .space K_STACK_BYTES ! kernel stack
- 36086 k_stktop: ! top of kernel stack
- 36087 .comm ex_number, 4
- 36088 .comm trap_errno, 4
- 36089 .comm old_eip, 4
- 36090 .comm old_cs, 4
- 36091 .comm old_eflags, 4
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/mpx88.s
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 36100 #
- 36101 ! This file contains the assembler startup code for Minix and the 16-bit
- 36102 ! interrupt handlers. It cooperates with cstart.c to set up a good
- 36103 ! environment for main().
- 36104
- 36105 ! This file is part of the lowest layer of the MINIX kernel. The other part
- 36106 ! is "proc.c". The lowest layer does process switching and message handling.
- 36107
- 36108 ! Every transition to the kernel goes through this file. Transitions are
- 36109 ! caused by sending/receiving messages and by most interrupts. (RS232
- 36110 ! interrupts may be handled in the file "rs2.s" and then they rarely enter
- 36111 ! the kernel.)
- 36112
- 36113 ! Transitions to the kernel may be nested. The initial entry may be with a
- 36114 ! system call, exception or hardware interrupt; reentries may only be made
- 36115 ! by hardware interrupts. The count of reentries is kept in "k_reenter".
- 36116 ! It is important for deciding whether to switch to the kernel stack and
- 36117 ! for protecting the message passing code in "proc.c".
- 36118
- 36119 ! For the message passing trap, most of the machine state is saved in the
- 36120 ! proc table. (Some of the registers need not be saved.) Then the stack is
- 36121 ! switched to "k_stack", and interrupts are reenabled. Finally, the system
- 36122 ! call handler (in C) is called. When it returns, interrupts are disabled
- 36123 ! again and the code falls into the restart routine, to finish off held-up
- 36124 ! interrupts and run the process or task whose pointer is in "proc_ptr".
- 36125
- 36126 ! Hardware interrupt handlers do the same, except (1) The entire state must
- 36127 ! be saved. (2) There are too many handlers to do this inline, so the save
- 36128 ! routine is called. A few cycles are saved by pushing the address of the
- 36129 ! appropiate restart routine for a return later. (3) A stack switch is
- 36130 ! avoided when the stack is already switched. (4) The (master) 8259 interrupt
- 36131 ! controller is reenabled centrally in save(). (5) Each interrupt handler
- 36132 ! masks its interrupt line using the 8259 before enabling (other unmasked)
- 36133 ! interrupts, and unmasks it after servicing the interrupt. This limits the
- 36134 ! nest level to the number of lines and protects the handler from itself.
- 36135
- 36136 ! For communication with the boot monitor at startup time some constant
- 36137 ! data are compiled into the beginning of the text segment. This facilitates
- 36138 ! reading the data at the start of the boot process, since only the first
- 36139 ! sector of the file needs to be read.
- 36140
- 36141 ! Some data storage is also allocated at the end of this file. This data
- 36142 ! will be at the start of the data segment of the kernel and will be read
- 36143 ! and modified by the boot monitor before the kernel starts.
- 36144
- 36145 #include <minix/config.h>
- 36146 #include <minix/const.h>
- 36147 #include <minix/com.h>
- 36148 #include "const.h"
- 36149 #include "sconst.h"
- 36150 #include "protect.h"
- 36151
- 36152 ! The external entry points into this file are:
- 36153 ! Note: in assembly language the .define statement applied to a function name
- 36154 ! is loosely equivalent to a prototype in C code -- it makes it possible to
- 36155 ! link to an entity declared in the assembly code but does not create
- 36156 ! the entity.
- 36157
- 36158 .define _idle_task ! executed when there is no work
- 36159 .define _int00 ! handlers for traps and exceptions
- 36160 .define _int01
- 36161 .define _int02
- 36162 .define _int03
- 36163 .define _int04
- 36164 .define _int05
- 36165 .define _int06
- 36166 .define _int07
- 36167 .define _hwint00 ! handlers for hardware interrupts
- 36168 .define _hwint01
- 36169 .define _hwint02
- 36170 .define _hwint03
- 36171 .define _hwint04
- 36172 .define _hwint05
- 36173 .define _hwint06
- 36174 .define _hwint07
- 36175 .define _hwint08
- 36176 .define _hwint09
- 36177 .define _hwint10
- 36178 .define _hwint11
- 36179 .define _hwint12
- 36180 .define _hwint13
- 36181 .define _hwint14
- 36182 .define _hwint15
- 36183 .define _restart ! start running a task or process
- 36184 .define save ! save the machine state in the proc table
- 36185 .define _s_call ! process or task wants to send or receive a message
- 36186
- 36187 ! Imported functions.
- 36188
- 36189 .extern _cstart
- 36190 .extern _main
- 36191 .extern _exception
- 36192 .extern _interrupt
- 36193 .extern _sys_call
- 36194 .extern _unhold
- 36195 .extern klib_init_prot
- 36196 .extern real2prot
- 36197
- 36198 ! Exported variables.
- 36199 ! Note: when used with a variable the .define does not reserve storage,
- 36200 ! it makes the name externally visible so it may be linked to.
- 36201
- 36202 .define kernel_ds
- 36203 .define begbss
- 36204 .define begdata
- 36205 .define _sizes
- 36206
- 36207 ! Imported variables.
- 36208
- 36209 .extern kernel_cs
- 36210 .extern _gdt
- 36211 .extern _code_base
- 36212 .extern _data_base
- 36213 .extern _held_head
- 36214 .extern _k_reenter
- 36215 .extern _pc_at
- 36216 .extern _proc_ptr
- 36217 .extern _protected_mode
- 36218 .extern _ps_mca
- 36219 .extern _irq_table
- 36220
- 36221 .text
- 36222 !*===========================================================================*
- 36223 !* MINIX *
- 36224 !*===========================================================================*
- 36225 MINIX: ! this is the entry point for the MINIX kernel
- 36226 jmp over_kernel_ds ! skip over the next few bytes
- 36227 .data2 CLICK_SHIFT ! for the monitor: memory granularity
- 36228 kernel_ds:
- 36229 .data2 0x0024 ! boot monitor flags: (later kernel DS)
- 36230 ! make stack, will return
- 36231 over_kernel_ds:
- 36232
- 36233 ! Set up a C stack frame on the monitor stack. (The monitor sets cs and ds
- 36234 ! right. The ss register still references the monitor data segment.)
- 36235 push bp
- 36236 mov bp, sp
- 36237 push si
- 36238 push di
- 36239 mov cx, 4(bp) ! monitor code segment
- 36240 test cx, cx ! nonzero if return possible
- 36241 jz noret
- 36242 inc _mon_return
- 36243 noret: mov _mon_ss, ss ! save stack location for later return
- 36244 mov _mon_sp, sp
- 36245
- 36246 ! Locate boot parameters, set up kernel segment registers and stack.
- 36247 mov bx, 6(bp) ! boot parameters offset
- 36248 mov dx, 8(bp) ! boot parameters length
- 36249 mov ax, ds ! kernel data
- 36250 mov es, ax
- 36251 mov ss, ax
- 36252 mov sp, #k_stktop ! set sp to point to the top of kernel stack
- 36253
- 36254 ! Real mode needs to get kernel DS from the code segment. Protected mode
- 36255 ! needs CS in the jump back to real mode.
- 36256
- 36257 cseg mov kernel_cs, cs
- 36258 cseg mov kernel_ds, ds
- 36259
- 36260 ! Call C startup code to set up a proper environment to run main().
- 36261 push dx
- 36262 push bx
- 36263 push _mon_ss
- 36264 push cx
- 36265 push ds
- 36266 push cs
- 36267 call _cstart ! cstart(cs, ds, mcs, mds, parmoff, parmlen)
- 36268 add sp, #6*2
- 36269
- 36270 cmp _protected_mode, #0
- 36271 jz nosw ! ok to switch to protected mode?
- 36272
- 36273 call klib_init_prot ! initialize klib functions for protected mode
- 36274 call real2prot ! switch to protected mode
- 36275
- 36276 push #0 ! set flags to known good state
- 36277 popf ! especially, clear nested task and int enable
- 36278 nosw:
- 36279 jmp _main ! main()
- 36280
- 36281
- 36282 !*===========================================================================*
- 36283 !* interrupt handlers *
- 36284 !*===========================================================================*
- 36285
- 36286
- 36287 !*===========================================================================*
- 36288 !* hwint00 - 07 *
- 36289 !*===========================================================================*
- 36290 ! Note this is a macro, it looks like a subroutine.
- 36291 #define hwint_master(irq)
- 36292 call save /* save interrupted process state */;
- 36293 inb INT_CTLMASK ;
- 36294 orb al, *[1<<irq] ;
- 36295 outb INT_CTLMASK /* disable the irq */;
- 36296 movb al, *ENABLE ;
- 36297 outb INT_CTL /* reenable master 8259 */;
- 36298 sti /* enable interrupts */;
- 36299 mov ax, *irq ;
- 36300 push ax /* irq */;
- 36301 call @_irq_table + 2*irq /* ax = (*irq_table[irq])(irq) */;
- 36302 pop cx ;
- 36303 cli /* disable interrupts */;
- 36304 test ax, ax /* need to reenable irq? */;
- 36305 jz 0f ;
- 36306 inb INT_CTLMASK ;
- 36307 andb al, *~[1<<irq] ;
- 36308 outb INT_CTLMASK /* enable the irq */;
- 36309 0: ret /* restart (another) process */
- 36310
- 36311 ! Each of these entry points is an expansion of the hwint_master macro
- 36312
- 36313 _hwint00: ! Interrupt routine for irq 0 (the clock).
- 36314 hwint_master(0)
- 36315
- 36316
- 36317 _hwint01: ! Interrupt routine for irq 1 (keyboard)
- 36318 hwint_master(1)
- 36319
- 36320
- 36321 _hwint02: ! Interrupt routine for irq 2 (cascade!)
- 36322 hwint_master(2)
- 36323
- 36324
- 36325 _hwint03: ! Interrupt routine for irq 3 (second serial)
- 36326 hwint_master(3)
- 36327
- 36328
- 36329 _hwint04: ! Interrupt routine for irq 4 (first serial)
- 36330 hwint_master(4)
- 36331
- 36332
- 36333 _hwint05: ! Interrupt routine for irq 5 (XT winchester)
- 36334 hwint_master(5)
- 36335
- 36336
- 36337 _hwint06: ! Interrupt routine for irq 6 (floppy)
- 36338 hwint_master(6)
- 36339
- 36340
- 36341 _hwint07: ! Interrupt routine for irq 7 (printer)
- 36342 hwint_master(7)
- 36343
- 36344
- 36345 !*===========================================================================*
- 36346 !* hwint08 - 15 *
- 36347 !*===========================================================================*
- 36348 ! Note this is a macro, it looks like a subroutine.
- 36349 #define hwint_slave(irq)
- 36350 call save /* save interrupted process state */;
- 36351 inb INT2_CTLMASK ;
- 36352 orb al, *[1<<[irq-8]] ;
- 36353 outb INT2_CTLMASK /* disable the irq */;
- 36354 movb al, *ENABLE ;
- 36355 outb INT_CTL /* reenable master 8259 */;
- 36356 jmp .+2 /* delay */;
- 36357 outb INT2_CTL /* reenable slave 8259 */;
- 36358 sti /* enable interrupts */;
- 36359 mov ax, *irq ;
- 36360 push ax /* irq */;
- 36361 call @_irq_table + 2*irq /* eax = (*irq_table[irq])(irq) */;
- 36362 pop cx ;
- 36363 cli /* disable interrupts */;
- 36364 test ax, ax /* need to reenable irq? */;
- 36365 jz 0f ;
- 36366 inb INT2_CTLMASK ;
- 36367 andb al, *~[1<<[irq-8]] ;
- 36368 outb INT2_CTLMASK /* enable the irq */;
- 36369 0: ret /* restart (another) process */
- 36370
- 36371 ! Each of these entry points is an expansion of the hwint_slave macro
- 36372
- 36373 _hwint08: ! Interrupt routine for irq 8 (realtime clock)
- 36374 hwint_slave(8)
- 36375
- 36376
- 36377 _hwint09: ! Interrupt routine for irq 9 (irq 2 redirected)
- 36378 hwint_slave(9)
- 36379
- 36380
- 36381 _hwint10: ! Interrupt routine for irq 10
- 36382 hwint_slave(10)
- 36383
- 36384
- 36385 _hwint11: ! Interrupt routine for irq 11
- 36386 hwint_slave(11)
- 36387
- 36388
- 36389 _hwint12: ! Interrupt routine for irq 12
- 36390 hwint_slave(12)
- 36391
- 36392
- 36393 _hwint13: ! Interrupt routine for irq 13 (FPU exception)
- 36394 hwint_slave(13)
- 36395
- 36396
- 36397 _hwint14: ! Interrupt routine for irq 14 (AT winchester)
- 36398 hwint_slave(14)
- 36399
- 36400
- 36401 _hwint15: ! Interrupt routine for irq 15
- 36402 hwint_slave(15)
- 36403
- 36404
- 36405 !*===========================================================================*
- 36406 !* save *
- 36407 !*===========================================================================*
- 36408 save: ! save the machine state in the proc table.
- 36409
- 36410 ! In protected mode a jump to p_save is patched over the following
- 36411 ! code during initialization.
- 36412
- 36413 cld ! set direction flag to a known value
- 36414 push ds
- 36415 push si
- 36416 cseg mov ds,kernel_ds
- 36417 incb _k_reenter ! from -1 if not reentering
- 36418 jnz push_current_stack ! stack is already kernel stack
- 36419
- 36420 mov si,_proc_ptr
- 36421 mov AXREG(si),ax
- 36422 mov BXREG(si),bx
- 36423 mov CXREG(si),cx
- 36424 mov DXREG(si),dx
- 36425 pop SIREG(si)
- 36426 mov DIREG(si),di
- 36427 mov BPREG(si),bp
- 36428 mov ESREG(si),es
- 36429 pop DSREG(si)
- 36430 pop bx ! return adr
- 36431 pop PCREG(si)
- 36432 pop CSREG(si)
- 36433 pop PSWREG(si)
- 36434 mov SPREG(si),sp
- 36435 mov SSREG(si),ss
- 36436
- 36437 mov dx,ds
- 36438 mov ss,dx
- 36439 mov sp,#k_stktop
- 36440 mov ax,#_restart ! build return address for interrupt handler
- 36441 push ax
- 36442
- 36443 stack_switched:
- 36444 mov es,dx
- 36445 jmp (bx)
- 36446
- 36447 push_current_stack:
- 36448 push es
- 36449 push bp
- 36450 push di
- 36451 push dx
- 36452 push cx
- 36453 push bx
- 36454 push ax
- 36455 mov bp,sp
- 36456 mov bx,18(bp) ! get the return adr; it becomes junk on stack
- 36457 mov ax,#restart1
- 36458 push ax
- 36459 mov dx,ss
- 36460 mov ds,dx
- 36461 jmp stack_switched
- 36462
- 36463
- 36464 !*===========================================================================*
- 36465 !* s_call *
- 36466 !*===========================================================================*
- 36467 ! This is real mode version. Alternate (_p_s_call) will be used in
- 36468 ! protected mode
- 36469
- 36470 _s_call: ! System calls are vectored here.
- 36471 ! Do save routine inline for speed,
- 36472 ! but do not save ax, bx, cx, dx,
- 36473 ! since C does not require preservation,
- 36474 ! and ax returns the result code anyway.
- 36475 ! Regs bp, si, di get saved by sys_call as
- 36476 ! well, but it is impractical not to preserve
- 36477 ! them here, in case context gets switched.
- 36478 ! Some special-case code in pick_proc()
- 36479 ! could avoid this.
- 36480 cld ! set direction flag to a known value
- 36481 push ds
- 36482 push si
- 36483 cseg mov ds,kernel_ds
- 36484 incb _k_reenter
- 36485 mov si,_proc_ptr
- 36486 pop SIREG(si)
- 36487 mov DIREG(si),di
- 36488 mov BPREG(si),bp
- 36489 mov ESREG(si),es
- 36490 pop DSREG(si)
- 36491 pop PCREG(si)
- 36492 pop CSREG(si)
- 36493 pop PSWREG(si)
- 36494 mov SPREG(si),sp
- 36495 mov SSREG(si),ss
- 36496 mov dx,ds
- 36497 mov es,dx
- 36498 mov ss,dx ! interrupt handlers may not make system calls
- 36499 mov sp,#k_stktop ! so stack is not already switched
- 36500 ! end of inline save
- 36501 ! now set up parameters for C routine sys_call
- 36502 push bx ! pointer to user message
- 36503 push ax ! src/dest
- 36504 push cx ! SEND/RECEIVE/BOTH
- 36505 sti ! allow SWITCHER to be interrupted
- 36506 call _sys_call ! sys_call(function, src_dest, m_ptr)
- 36507 ! caller is now explicitly in proc_ptr
- 36508 mov AXREG(si),ax ! sys_call MUST PRESERVE si
- 36509 cli
- 36510
- 36511 ! Fall into code to restart proc/task running.
- 36512
- 36513
- 36514 !*===========================================================================*
- 36515 !* restart *
- 36516 !*===========================================================================*
- 36517 _restart:
- 36518
- 36519 ! Flush any held-up interrupts.
- 36520 ! This reenables interrupts, so the current interrupt handler may reenter.
- 36521 ! This does not matter, because the current handler is about to exit and no
- 36522 ! other handlers can reenter since flushing is only done when k_reenter == 0.
- 36523
- 36524 ! In protected mode a jump to p_restart is patched over the following
- 36525 ! code during initialization.
- 36526
- 36527 cmp _held_head,#0 ! do fast test to usually avoid function call
- 36528 jz over_call_unhold
- 36529 call _unhold ! this is rare so overhead is acceptable
- 36530 over_call_unhold:
- 36531
- 36532 mov si,_proc_ptr
- 36533 decb _k_reenter
- 36534 mov ax,AXREG(si) ! start restoring registers from proc table
- 36535 ! could make AXREG == 0 to use lodw here
- 36536 mov bx,BXREG(si)
- 36537 mov cx,CXREG(si)
- 36538 mov dx,DXREG(si)
- 36539 mov di,DIREG(si)
- 36540 mov bp,BPREG(si)
- 36541 mov es,ESREG(si)
- 36542 mov ss,SSREG(si)
- 36543 mov sp,SPREG(si)
- 36544 push PSWREG(si) ! fake interrupt stack frame
- 36545 push CSREG(si)
- 36546 push PCREG(si)
- 36547 ! could put si:ds together to use
- 36548 ! lds si,SIREG(si)
- 36549 push DSREG(si)
- 36550 mov si,SIREG(si)
- 36551 pop ds
- 36552 iret
- 36553
- 36554 restart1:
- 36555 decb _k_reenter
- 36556 pop ax
- 36557 pop bx
- 36558 pop cx
- 36559 pop dx
- 36560 pop di
- 36561 pop bp
- 36562 pop es
- 36563 pop si
- 36564 pop ds
- 36565 add sp,#2 ! skip return adr
- 36566 iret
- 36567
- 36568
- 36569 !*===========================================================================*
- 36570 !* int00-07 *
- 36571 !*===========================================================================*
- 36572 ! These are entry points for exceptions (processor generated interrupts,
- 36573 ! usually caused by error conditions such as an attempt to divide by zero)
- 36574
- 36575 _int00: ! interrupt through vector 0
- 36576 push ax
- 36577 movb al,#0
- 36578 jmp exception
- 36579
- 36580 _int01: ! interrupt through vector 1, etc
- 36581 push ax
- 36582 movb al,#1
- 36583 jmp exception
- 36584
- 36585 _int02:
- 36586 push ax
- 36587 movb al,#2
- 36588 jmp exception
- 36589
- 36590 _int03:
- 36591 push ax
- 36592 movb al,#3
- 36593 jmp exception
- 36594
- 36595 _int04:
- 36596 push ax
- 36597 movb al,#4
- 36598 jmp exception
- 36599
- 36600 _int05:
- 36601 push ax
- 36602 movb al,#5
- 36603 jmp exception
- 36604
- 36605 _int06:
- 36606 push ax
- 36607 movb al,#6
- 36608 jmp exception
- 36609
- 36610 _int07:
- 36611 push ax
- 36612 movb al,#7
- 36613 !jmp exception
- 36614
- 36615 exception:
- 36616 cseg movb ex_number,al ! it is cumbersome to get this into dseg
- 36617 pop ax
- 36618 call save
- 36619 cseg push ex_number ! high byte is constant 0
- 36620 call _exception ! do whatever is necessary (sti only if safe)
- 36621 add sp,#2
- 36622 cli
- 36623 ret
- 36624
- 36625
- 36626 !*===========================================================================*
- 36627 !* level0_call *
- 36628 !*===========================================================================*
- 36629 _level0_call:
- 36630 call save
- 36631 jmp @_level0_func
- 36632
- 36633
- 36634 !*===========================================================================*
- 36635 !* idle_task *
- 36636 !*===========================================================================*
- 36637 _idle_task: ! executed when there is no work
- 36638 jmp _idle_task ! a "hlt" before this fails in protected mode
- 36639
- 36640
- 36641 !*===========================================================================*
- 36642 !* data *
- 36643 !*===========================================================================*
- 36644 ! NB some variables are stored in code segment.
- 36645
- 36646 ex_number: ! exception number
- 36647 .space 2
- 36648
- 36649
- 36650 !*===========================================================================*
- 36651 !* variants for 286 protected mode *
- 36652 !*===========================================================================*
- 36653
- 36654 ! Most routines are different in 286 protected mode.
- 36655 ! The only essential difference is that an interrupt in protected mode
- 36656 ! (usually) switches the stack, so there is less to do in software.
- 36657
- 36658 ! These functions are reached along jumps patched in by klib_init_prot():
- 36659
- 36660 .define p_restart ! replaces _restart
- 36661 .define p_save ! replaces save
- 36662
- 36663 ! These exception and software-interrupt handlers are enabled by the new
- 36664 ! interrupt vector table set up in protect.c:
- 36665
- 36666 .define _divide_error ! _int00
- 36667 .define _single_step_exception ! _int01
- 36668 .define _nmi ! _int02
- 36669 .define _breakpoint_exception ! _int03
- 36670 .define _overflow ! _int04
- 36671 .define _bounds_check ! _int05
- 36672 .define _inval_opcode ! _int06
- 36673 .define _copr_not_available ! _int07
- 36674 .define _double_fault ! (286 trap)
- 36675 .define _copr_seg_overrun ! (etc)
- 36676 .define _inval_tss
- 36677 .define _segment_not_present
- 36678 .define _stack_exception
- 36679 .define _general_protection
- 36680 .define _p_s_call ! _s_call
- 36681 .define _level0_call
- 36682
- 36683 ! The hardware interrupt handlers need not be altered apart from putting
- 36684 ! them in the new table (save() handles the differences).
- 36685 ! Some of the intxx handlers (those for exceptions which do not push an
- 36686 ! error code) need not have been replaced, but the names here are better.
- 36687
- 36688 #include "protect.h"
- 36689
- 36690 /* Selected 286 tss offsets. */
- 36691 #define TSS2_S_SP0 2
- 36692
- 36693 ! imported variables
- 36694
- 36695 .extern _tss
- 36696 .extern _level0_func
- 36697
- 36698 !*===========================================================================*
- 36699 !* p_save *
- 36700 !*===========================================================================*
- 36701 ! Save for 286 protected mode.
- 36702 ! This is much simpler than for 8086 mode, because the stack already points
- 36703 ! into process table, or has already been switched to the kernel stack.
- 36704
- 36705 p_save:
- 36706 cld ! set direction flag to a known value
- 36707 pusha ! save "general" registers
- 36708 push ds ! save ds
- 36709 push es ! save es
- 36710 mov dx,ss ! ss is kernel data segment
- 36711 mov ds,dx ! load rest of kernel segments
- 36712 mov es,dx
- 36713 mov bp,sp ! prepare to return
- 36714 incb _k_reenter ! from -1 if not reentering
- 36715 jnz set_p1_restart ! stack is already kernel stack
- 36716 mov sp,#k_stktop
- 36717 push #p_restart ! build return address for interrupt handler
- 36718 jmp @RETADR-P_STACKBASE(bp)
- 36719
- 36720 set_p1_restart:
- 36721 push #p1_restart
- 36722 jmp @RETADR-P_STACKBASE(bp)
- 36723
- 36724
- 36725 !*===========================================================================*
- 36726 !* p_s_call *
- 36727 !*===========================================================================*
- 36728 _p_s_call:
- 36729 cld ! set direction flag to a known value
- 36730 sub sp,#6*2 ! skip RETADR, ax, cx, dx, bx, st
- 36731 push bp ! stack already points into process table
- 36732 push si
- 36733 push di
- 36734 push ds
- 36735 push es
- 36736 mov dx,ss
- 36737 mov ds,dx
- 36738 mov es,dx
- 36739 incb _k_reenter
- 36740 mov si,sp ! assumes P_STACKBASE == 0
- 36741 mov sp,#k_stktop
- 36742 ! end of inline save
- 36743 sti ! allow SWITCHER to be interrupted
- 36744 ! now set up parameters for C routine sys_call
- 36745 push bx ! pointer to user message
- 36746 push ax ! src/dest
- 36747 push cx ! SEND/RECEIVE/BOTH
- 36748 call _sys_call ! sys_call(function, src_dest, m_ptr)
- 36749 ! caller is now explicitly in proc_ptr
- 36750 mov AXREG(si),ax ! sys_call MUST PRESERVE si
- 36751 cli
- 36752
- 36753 ! Fall into code to restart proc/task running.
- 36754
- 36755 p_restart:
- 36756
- 36757 ! Flush any held-up interrupts.
- 36758 ! This reenables interrupts, so the current interrupt handler may reenter.
- 36759 ! This does not matter, because the current handler is about to exit and no
- 36760 ! other handlers can reenter since flushing is only done when k_reenter == 0.
- 36761
- 36762 cmp _held_head,#0 ! do fast test to usually avoid function call
- 36763 jz p_over_call_unhold
- 36764 call _unhold ! this is rare so overhead is acceptable
- 36765 p_over_call_unhold:
- 36766 mov si,_proc_ptr
- 36767 lldt P_LDT_SEL(si) ! enable segment descriptors for task
- 36768 lea ax,P_STACKTOP(si) ! arrange for next interrupt
- 36769 mov _tss+TSS2_S_SP0,ax ! to save state in process table
- 36770 mov sp,si ! assumes P_STACKBASE == 0
- 36771 p1_restart:
- 36772 decb _k_reenter
- 36773 pop es
- 36774 pop ds
- 36775 popa
- 36776 add sp,#2 ! skip return adr
- 36777 iret ! continue process
- 36778
- 36779
- 36780 !*===========================================================================*
- 36781 !* exception handlers *
- 36782 !*===========================================================================*
- 36783 _divide_error:
- 36784 push #DIVIDE_VECTOR
- 36785 jmp p_exception
- 36786
- 36787 _single_step_exception:
- 36788 push #DEBUG_VECTOR
- 36789 jmp p_exception
- 36790
- 36791 _nmi:
- 36792 push #NMI_VECTOR
- 36793 jmp p_exception
- 36794
- 36795 _breakpoint_exception:
- 36796 push #BREAKPOINT_VECTOR
- 36797 jmp p_exception
- 36798
- 36799 _overflow:
- 36800 push #OVERFLOW_VECTOR
- 36801 jmp p_exception
- 36802
- 36803 _bounds_check:
- 36804 push #BOUNDS_VECTOR
- 36805 jmp p_exception
- 36806
- 36807 _inval_opcode:
- 36808 push #INVAL_OP_VECTOR
- 36809 jmp p_exception
- 36810
- 36811 _copr_not_available:
- 36812 push #COPROC_NOT_VECTOR
- 36813 jmp p_exception
- 36814
- 36815 _double_fault:
- 36816 push #DOUBLE_FAULT_VECTOR
- 36817 jmp errexception
- 36818
- 36819 _copr_seg_overrun:
- 36820 push #COPROC_SEG_VECTOR
- 36821 jmp p_exception
- 36822
- 36823 _inval_tss:
- 36824 push #INVAL_TSS_VECTOR
- 36825 jmp errexception
- 36826
- 36827 _segment_not_present:
- 36828 push #SEG_NOT_VECTOR
- 36829 jmp errexception
- 36830
- 36831 _stack_exception:
- 36832 push #STACK_FAULT_VECTOR
- 36833 jmp errexception
- 36834
- 36835 _general_protection:
- 36836 push #PROTECTION_VECTOR
- 36837 jmp errexception
- 36838
- 36839
- 36840 !*===========================================================================*
- 36841 !* p_exception *
- 36842 !*===========================================================================*
- 36843 ! This is called for all exceptions which do not push an error code.
- 36844
- 36845 p_exception:
- 36846 sseg pop ds_ex_number
- 36847 call p_save
- 36848 jmp p1_exception
- 36849
- 36850
- 36851 !*===========================================================================*
- 36852 !* errexception *
- 36853 !*===========================================================================*
- 36854 ! This is called for all exceptions which push an error code.
- 36855
- 36856 errexception:
- 36857 sseg pop ds_ex_number
- 36858 sseg pop trap_errno
- 36859 call p_save
- 36860 p1_exception: ! Common for all exceptions.
- 36861 push ds_ex_number
- 36862 call _exception
- 36863 add sp,#2
- 36864 cli
- 36865 ret
- 36866
- 36867
- 36868 !*===========================================================================*
- 36869 !* data *
- 36870 !*===========================================================================*
- 36871 ! These declarations assure that storage will be allocated at the very
- 36872 ! beginning of the kernel data section, so the boot monitor can be easily
- 36873 ! told how to patch these locations. Note that the magic number is put
- 36874 ! here by the compiler, but will be read by, and then overwritten by,
- 36875 ! the boot monitor. When the kernel starts the sizes array will be
- 36876 ! found here, as if it had been initialized by the compiler.
- 36877
- 36878 .data
- 36879 begdata:
- 36880 _sizes: ! sizes of kernel, mm, fs filled in by boot
- 36881 .data2 0x526F ! this must be the first data entry (magic #)
- 36882 .space 16*2*2-2 ! monitor uses previous 2 words and this space
- 36883 ! extra space allows for additional servers
- 36884 .bss
- 36885 begbss:
- 36886 k_stack:
- 36887 .space K_STACK_BYTES ! kernel stack
- 36888 k_stktop: ! top of kernel stack
- 36889 ds_ex_number:
- 36890 .space 2
- 36891 trap_errno:
- 36892 .space 2
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/keymaps/genmap.c
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 36900 /* genmap - output binary keymap Author: Marcus Hampel
- 36901 */
- 36902 #include <sys/types.h>
- 36903 #include <minix/keymap.h>
- 36904 #include <fcntl.h>
- 36905 #include <unistd.h>
- 36906 #include <stdlib.h>
- 36907 #include <string.h>
- 36908 #include <errno.h>
- 36909
- 36910 #include KEYSRC
- 36911
- 36912 u8_t comprmap[4 + NR_SCAN_CODES * MAP_COLS * 9/8 * 2 + 1];
- 36913
- 36914 void tell(const char *s)
- 36915 {
- 36916 write(2, s, strlen(s));
- 36917 }
-
- 36919 int main(void)
- 36920 {
- 36921 u8_t *cm, *fb;
- 36922 u16_t *km;
- 36923 int n;
- 36924
- 36925 /* Compress the keymap. */
- 36926 memcpy(comprmap, KEY_MAGIC, 4);
- 36927 cm = comprmap + 4;
- 36928 n = 8;
- 36929 for (km = keymap; km < keymap + NR_SCAN_CODES * MAP_COLS; km++) {
- 36930 if (n == 8) {
- 36931 /* Allocate a new flag byte. */
- 36932 fb = cm;
- 36933 *cm++ = 0;
- 36934 n= 0;
- 36935 }
- 36936 *cm++ = (*km & 0x00FF); /* Low byte. */
- 36937 if (*km & 0xFF00) {
- 36938 *cm++ = (*km >> 8); /* High byte only when set. */
- 36939 *fb |= (1 << n); /* Set a flag if so. */
- 36940 }
- 36941 n++;
- 36942 }
- 36943
- 36944 /* Don't store trailing zeros. */
- 36945 while (cm > comprmap && cm[-1] == 0) cm--;
- 36946
- 36947 /* Emit the compressed keymap. */
- 36948 if (write(1, comprmap, cm - comprmap) < 0) {
- 36949 int err = errno;
- 36950
- 36951 tell("genmap: ");
- 36952 tell(strerror(err));
- 36953 tell("n");
- 36954 exit(1);
- 36955 }
- 36956 exit(0);
- 36957 }
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/keymaps/french.src
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 37000 /* Keymap for the French keyboard. */
- 37001
- 37002 u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
- 37003
- 37004 /* scan-code !Shift Shift Alt AltGr Alt+Sh Ctrl */
- 37005 /* ==================================================================== */
- 37006 /* 00 - none */ 0, 0, 0, 0, 0, 0,
- 37007 /* 01 - ESC */ C('['), C('['), CA('['),C('['), C('['), C('['),
- 37008 /* 02 - '1' */ '&', '1', A('1'), '&', '1', C('A'),
- 37009 /* 03 - '2' */ 0202, '2', A('2'), '~', '2', C('B'),
- 37010 /* 04 - '3' */ '"', '3', A('3'), '#', '3', C('C'),
- 37011 /* 05 - '4' */ ''', '4', A('4'), '{', '4', C('D'),
- 37012 /* 06 - '5' */ '(', '5', A('5'), '[', '5', C('E'),
- 37013 /* 07 - '6' */ '-', '6', A('6'), '|', '6', C('F'),
- 37014 /* 08 - '7' */ 0212, '7', A('7'), '`', '7', C('G'),
- 37015 /* 09 - '8' */ '_', '8', A('8'), '\', '8', C('H'),
- 37016 /* 10 - '9' */ 0207, '9', A('9'), '^', '9', C('I'),
- 37017 /* 11 - '0' */ 0205, '0', A('0'), '@', '0', C('J'),
- 37018 /* 12 - '-' */ ')', 0370, A(')'), ']', '-', C('K'),
- 37019 /* 13 - '=' */ '=', '+', A('='), '}', '=', C('L'),
- 37020 /* 14 - BS */ C('H'), C('H'), CA('H'),C('H'), C('H'), 0177,
- 37021 /* 15 - TAB */ C('I'), C('I'), CA('I'),C('I'), C('I'), C('I'),
- 37022 /* 16 - 'q' */ L('a'), 'A', A('a'), 'a', 'Q', C('A'),
- 37023 /* 17 - 'w' */ L('z'), 'Z', A('z'), 'z', 'W', C('Z'),
- 37024 /* 18 - 'e' */ L('e'), 'E', A('e'), 'e', 'E', C('E'),
- 37025 /* 19 - 'r' */ L('r'), 'R', A('r'), 'r', 'R', C('R'),
- 37026 /* 20 - 't' */ L('t'), 'T', A('t'), 't', 'T', C('T'),
- 37027 /* 21 - 'y' */ L('y'), 'Y', A('y'), 'y', 'Y', C('Y'),
- 37028 /* 22 - 'u' */ L('u'), 'U', A('u'), 'u', 'U', C('U'),
- 37029 /* 23 - 'i' */ L('i'), 'I', A('i'), 'i', 'I', C('I'),
- 37030 /* 24 - 'o' */ L('o'), 'O', A('o'), 'o', 'O', C('O'),
- 37031 /* 25 - 'p' */ L('p'), 'P', A('p'), 'p', 'P', C('P'),
- 37032 /* 26 - '[' */ '^', '"', A('^'), '^', '[', C('^'),
- 37033 /* 27 - ']' */ '$', 0234, A('$'), '$', ']', C('$'),
- 37034 /* 28 - CR/LF */ C('M'), C('M'), CA('M'),C('M'), C('M'), C('J'),
- 37035 /* 29 - Ctrl */ CTRL, CTRL, CTRL, CTRL, CTRL, CTRL,
- 37036 /* 30 - 'a' */ L('q'), 'Q', A('q'), 'q', 'A', C('Q'),
- 37037 /* 31 - 's' */ L('s'), 'S', A('s'), 's', 'S', C('S'),
- 37038 /* 32 - 'd' */ L('d'), 'D', A('d'), 'd', 'D', C('D'),
- 37039 /* 33 - 'f' */ L('f'), 'F', A('f'), 'f', 'F', C('F'),
- 37040 /* 34 - 'g' */ L('g'), 'G', A('g'), 'g', 'G', C('G'),
- 37041 /* 35 - 'h' */ L('h'), 'H', A('h'), 'h', 'H', C('H'),
- 37042 /* 36 - 'j' */ L('j'), 'J', A('j'), 'j', 'J', C('J'),
- 37043 /* 37 - 'k' */ L('k'), 'K', A('k'), 'k', 'K', C('K'),
- 37044 /* 38 - 'l' */ L('l'), 'L', A('l'), 'l', 'L', C('L'),
- 37045 /* 39 - ';' */ L('m'), 'M', A('m'), 'm', 'M', C('M'),
- 37046 /* 40 - ''' */ 0227, '%', A('%'), 0227, '\', C('G'),
- 37047 /* 41 - '`' */ 0375, 0375, 0375, 0375, '`', C('['),
- 37048 /* 42 - l. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37049 /* 43 - '`' */ '*', 0346, A('*'), '*', '`', C('*'),
- 37050 /* 44 - 'z' */ L('w'), 'W', A('w'), 'w', 'Z', C('W'),
- 37051 /* 45 - 'x' */ L('x'), 'X', A('x'), 'x', 'X', C('X'),
- 37052 /* 46 - 'c' */ L('c'), 'C', A('c'), 'c', 'C', C('C'),
- 37053 /* 47 - 'v' */ L('v'), 'V', A('v'), 'v', 'V', C('V'),
- 37054 /* 48 - 'b' */ L('b'), 'B', A('b'), 'b', 'B', C('B'),
- 37055 /* 49 - 'n' */ L('n'), 'N', A('n'), 'n', 'N', C('N'),
- 37056 /* 50 - 'm' */ ',', '?', A(','), ',', 'm', C('@'),
- 37057 /* 51 - ',' */ ';', '.', A(';'), ';', ',', C('@'),
- 37058 /* 52 - '.' */ ':', '/', A(':'), ':', '.', C('@'),
- 37059 /* 53 - '/' */ '!', '$'/*025*/,A('!'), '!', '/', C('@'),
- 37060 /* 54 - r. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37061 /* 55 - '*' */ '*', '*', A('*'), '*', '*', C('@'),
- 37062 /* 56 - ALT */ ALT, ALT, ALT, ALT, ALT, ALT,
- 37063 /* 57 - ' ' */ ' ', ' ', A(' '), ' ', ' ', C('@'),
- 37064 /* 58 - CapsLck */ CALOCK, CALOCK, CALOCK, CALOCK, CALOCK, CALOCK,
- 37065 /* 59 - F1 */ F1, SF1, AF1, AF1, ASF1, CF1,
- 37066 /* 60 - F2 */ F2, SF2, AF2, AF2, ASF2, CF2,
- 37067 /* 61 - F3 */ F3, SF3, AF3, AF3, ASF3, CF3,
- 37068 /* 62 - F4 */ F4, SF4, AF4, AF4, ASF4, CF4,
- 37069 /* 63 - F5 */ F5, SF5, AF5, AF5, ASF5, CF5,
- 37070 /* 64 - F6 */ F6, SF6, AF6, AF6, ASF6, CF6,
- 37071 /* 65 - F7 */ F7, SF7, AF7, AF7, ASF7, CF7,
- 37072 /* 66 - F8 */ F8, SF8, AF8, AF8, ASF8, CF8,
- 37073 /* 67 - F9 */ F9, SF9, AF9, AF9, ASF9, CF9,
- 37074 /* 68 - F10 */ F10, SF10, AF10, AF10, ASF10, CF10,
- 37075 /* 69 - NumLock */ NLOCK, NLOCK, NLOCK, NLOCK, NLOCK, NLOCK,
- 37076 /* 70 - ScrLock */ SLOCK, SLOCK, SLOCK, SLOCK, SLOCK, SLOCK,
- 37077 /* 71 - Home */ HOME, '7', AHOME, AHOME, '7', CHOME,
- 37078 /* 72 - CurUp */ UP, '8', AUP, AUP, '8', CUP,
- 37079 /* 73 - PgUp */ PGUP, '9', APGUP, APGUP, '9', CPGUP,
- 37080 /* 74 - '-' */ NMIN, '-', ANMIN, ANMIN, '-', CNMIN,
- 37081 /* 75 - Left */ LEFT, '4', ALEFT, ALEFT, '4', CLEFT,
- 37082 /* 76 - MID */ MID, '5', AMID, AMID, '5', CMID,
- 37083 /* 77 - Right */ RIGHT, '6', ARIGHT, ARIGHT, '6', CRIGHT,
- 37084 /* 78 - '+' */ PLUS, '+', APLUS, APLUS, '+', CPLUS,
- 37085 /* 79 - End */ END, '1', AEND, AEND, '1', CEND,
- 37086 /* 80 - Down */ DOWN, '2', ADOWN, ADOWN, '2', CDOWN,
- 37087 /* 81 - PgDown */ PGDN, '3', APGDN, APGDN, '3', CPGDN,
- 37088 /* 82 - Insert */ INSRT, '0', AINSRT, AINSRT, '0', CINSRT,
- 37089 /* 83 - Delete */ 0177, '.', A(0177),0177, '.', 0177,
- 37090 /* 84 - Enter */ C('M'), C('M'), CA('M'),C('M'), C('M'), C('J'),
- 37091 /* 85 - ??? */ 0, 0, 0, 0, 0, 0,
- 37092 /* 86 - ??? */ '<', '>', A('<'), '<', '>', C('@'),
- 37093 /* 87 - F11 */ F11, SF11, AF11, AF11, ASF11, CF11,
- 37094 /* 88 - F12 */ F12, SF12, AF12, AF12, ASF12, CF12,
- 37095 /* 89 - ??? */ 0, 0, 0, 0, 0, 0,
- 37096 /* 90 - ??? */ 0, 0, 0, 0, 0, 0,
- 37097 /* 91 - ??? */ 0, 0, 0, 0, 0, 0,
- 37098 /* 92 - ??? */ 0, 0, 0, 0, 0, 0,
- 37099 /* 93 - ??? */ 0, 0, 0, 0, 0, 0,
- 37100 /* 94 - ??? */ 0, 0, 0, 0, 0, 0,
- 37101 /* 95 - ??? */ 0, 0, 0, 0, 0, 0,
- 37102 /* 96 - EXT_KEY */ EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY,
- 37103 /* 97 - ??? */ 0, 0, 0, 0, 0, 0,
- 37104 /* 98 - ??? */ 0, 0, 0, 0, 0, 0,
- 37105 /* 99 - ??? */ 0, 0, 0, 0, 0, 0,
- 37106 /*100 - ??? */ 0, 0, 0, 0, 0, 0,
- 37107 /*101 - ??? */ 0, 0, 0, 0, 0, 0,
- 37108 /*102 - ??? */ 0, 0, 0, 0, 0, 0,
- 37109 /*103 - ??? */ 0, 0, 0, 0, 0, 0,
- 37110 /*104 - ??? */ 0, 0, 0, 0, 0, 0,
- 37111 /*105 - ??? */ 0, 0, 0, 0, 0, 0,
- 37112 /*106 - ??? */ 0, 0, 0, 0, 0, 0,
- 37113 /*107 - ??? */ 0, 0, 0, 0, 0, 0,
- 37114 /*108 - ??? */ 0, 0, 0, 0, 0, 0,
- 37115 /*109 - ??? */ 0, 0, 0, 0, 0, 0,
- 37116 /*110 - ??? */ 0, 0, 0, 0, 0, 0,
- 37117 /*111 - ??? */ 0, 0, 0, 0, 0, 0,
- 37118 /*112 - ??? */ 0, 0, 0, 0, 0, 0,
- 37119 /*113 - ??? */ 0, 0, 0, 0, 0, 0,
- 37120 /*114 - ??? */ 0, 0, 0, 0, 0, 0,
- 37121 /*115 - ??? */ 0, 0, 0, 0, 0, 0,
- 37122 /*116 - ??? */ 0, 0, 0, 0, 0, 0,
- 37123 /*117 - ??? */ 0, 0, 0, 0, 0, 0,
- 37124 /*118 - ??? */ 0, 0, 0, 0, 0, 0,
- 37125 /*119 - ??? */ 0, 0, 0, 0, 0, 0,
- 37126 /*120 - ??? */ 0, 0, 0, 0, 0, 0,
- 37127 /*121 - ??? */ 0, 0, 0, 0, 0, 0,
- 37128 /*122 - ??? */ 0, 0, 0, 0, 0, 0,
- 37129 /*123 - ??? */ 0, 0, 0, 0, 0, 0,
- 37130 /*124 - ??? */ 0, 0, 0, 0, 0, 0,
- 37131 /*125 - ??? */ 0, 0, 0, 0, 0, 0,
- 37132 /*126 - ??? */ 0, 0, 0, 0, 0, 0,
- 37133 /*127 - ??? */ 0, 0, 0, 0, 0, 0
- 37134 };
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/keymaps/german.src
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 37200 /* Keymap for German MF-2 keyboard. */
- 37201
- 37202 u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
- 37203
- 37204 /* scan-code unsh Shift Alt AltGr Alt+Sh Strg */
- 37205 /* ==================================================================== */
- 37206 /* 00 - none */ 0, 0, 0, 0, 0, 0,
- 37207 /* 01 - ESC */ C('['), C('['), CA('['),C('['), C('['), C('['),
- 37208 /* 02 - '1' */ '1', '!', A('1'), '1', '!', C('A'),
- 37209 /* 03 - '2' */ '2', '"', A('2'), 0375, '@', C('@'),
- 37210 /* 04 - '3' */ '3', 025, A('3'), 0374, '#', C('C'),
- 37211 /* 05 - '4' */ '4', '$', A('4'), '4', '$', C('D'),
- 37212 /* 06 - '5' */ '5', '%', A('5'), '5', '%', C('E'),
- 37213 /* 07 - '6' */ '6', '&', A('6'), '6', '^', C('^'),
- 37214 /* 08 - '7' */ '7', '/', A('7'), '{', '&', C('G'),
- 37215 /* 09 - '8' */ '8', '(', A('8'), '[', '*', C('H'),
- 37216 /* 10 - '9' */ '9', ')', A('9'), ']', '(', C('I'),
- 37217 /* 11 - '0' */ '0', '=', A('0'), '}', ')', C('@'),
- 37218 /* 12 - '-' */ 0341, '?', 0341, '\', '_', C('_'),
- 37219 /* 13 - '=' */ ''', '`', A('''),'=', '+', C('@'),
- 37220 /* 14 - BS */ C('H'), C('H'), CA('H'),C('H'), C('H'), 0177,
- 37221 /* 15 - TAB */ C('I'), C('I'), CA('I'),C('I'), C('I'), C('I'),
- 37222 /* 16 - 'q' */ L('q'), 'Q', A('q'), '@', 'Q', C('Q'),
- 37223 /* 17 - 'w' */ L('w'), 'W', A('w'), 'w', 'W', C('W'),
- 37224 /* 18 - 'e' */ L('e'), 'E', A('e'), 'e', 'E', C('E'),
- 37225 /* 19 - 'r' */ L('r'), 'R', A('r'), 'r', 'R', C('R'),
- 37226 /* 20 - 't' */ L('t'), 'T', A('t'), 't', 'T', C('T'),
- 37227 /* 21 - 'y' */ L('z'), 'Z', A('z'), 'z', 'Z', C('Z'),
- 37228 /* 22 - 'u' */ L('u'), 'U', A('u'), 'u', 'U', C('U'),
- 37229 /* 23 - 'i' */ L('i'), 'I', A('i'), 'i', 'I', C('I'),
- 37230 /* 24 - 'o' */ L('o'), 'O', A('o'), 'o', 'O', C('O'),
- 37231 /* 25 - 'p' */ L('p'), 'P', A('p'), 'p', 'P', C('P'),
- 37232 /* 26 - '[' */ L(0201),0232, 0201, '[', '{', C('['),
- 37233 /* 27 - ']' */ '+', '*', A('+'), '~', ']', C(']'),
- 37234 /* 28 - CR/LF */ C('M'), C('M'), CA('M'),C('M'), C('M'), C('J'),
- 37235 /* 29 - Strg;-) */ CTRL, CTRL, CTRL, CTRL, CTRL, CTRL,
- 37236 /* 30 - 'a' */ L('a'), 'A', A('a'), 'a', 'A', C('A'),
- 37237 /* 31 - 's' */ L('s'), 'S', A('s'), 's', 'S', C('S'),
- 37238 /* 32 - 'd' */ L('d'), 'D', A('d'), 'd', 'D', C('D'),
- 37239 /* 33 - 'f' */ L('f'), 'F', A('f'), 'f', 'F', C('F'),
- 37240 /* 34 - 'g' */ L('g'), 'G', A('g'), 'g', 'G', C('G'),
- 37241 /* 35 - 'h' */ L('h'), 'H', A('h'), 'h', 'H', C('H'),
- 37242 /* 36 - 'j' */ L('j'), 'J', A('j'), 'j', 'J', C('J'),
- 37243 /* 37 - 'k' */ L('k'), 'K', A('k'), 'k', 'K', C('K'),
- 37244 /* 38 - 'l' */ L('l'), 'L', A('l'), 'l', 'L', C('L'),
- 37245 /* 39 - ';' */ L(0224),0231, 0224, ';', ':', C('@'),
- 37246 /* 40 - ''' */ L(0204),0216, 0204, ''', '"', C('@'),
- 37247 /* 41 - '`' */ '^', 0370, A('^'), '`', '~', C('^'),
- 37248 /* 42 - SHIFT */ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37249 /* 43 - '\' */ '#', ''', A('#'), '\', '|', C('\'),
- 37250 /* 44 - 'z' */ L('y'), 'Y', A('y'), 'y', 'Y', C('Y'),
- 37251 /* 45 - 'x' */ L('x'), 'X', A('x'), 'x', 'X', C('X'),
- 37252 /* 46 - 'c' */ L('c'), 'C', A('c'), 'c', 'C', C('C'),
- 37253 /* 47 - 'v' */ L('v'), 'V', A('v'), 'v', 'V', C('V'),
- 37254 /* 48 - 'b' */ L('b'), 'B', A('b'), 'b', 'B', C('B'),
- 37255 /* 49 - 'n' */ L('n'), 'N', A('n'), 'n', 'N', C('N'),
- 37256 /* 50 - 'm' */ L('m'), 'M', A('m'), 0346, 'M', C('M'),
- 37257 /* 51 - ',' */ ',', ';', A(','), ',', '<', C('@'),
- 37258 /* 52 - '.' */ '.', ':', A('.'), '.', '>', C('@'),
- 37259 /* 53 - '/' */ '-', '_', A('-'), '/', '?', C('_'),
- 37260 /* 54 - SHIFT */ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37261 /* 55 - '*' */ '*', '*', A('*'), '*', '*', C('@'),
- 37262 /* 56 - ALT */ ALT, ALT, ALT, ALT, ALT, ALT,
- 37263 /* 57 - ' ' */ ' ', ' ', A(' '), ' ', ' ', C('@'),
- 37264 /* 58 - CapsLck */ CALOCK, CALOCK, CALOCK, CALOCK, CALOCK, CALOCK,
- 37265 /* 59 - F1 */ F1, SF1, AF1, AF1, ASF1, CF1,
- 37266 /* 60 - F2 */ F2, SF2, AF2, AF2, ASF2, CF2,
- 37267 /* 61 - F3 */ F3, SF3, AF3, AF3, ASF3, CF3,
- 37268 /* 62 - F4 */ F4, SF4, AF4, AF4, ASF4, CF4,
- 37269 /* 63 - F5 */ F5, SF5, AF5, AF5, ASF5, CF5,
- 37270 /* 64 - F6 */ F6, SF6, AF6, AF6, ASF6, CF6,
- 37271 /* 65 - F7 */ F7, SF7, AF7, AF7, ASF7, CF7,
- 37272 /* 66 - F8 */ F8, SF8, AF8, AF8, ASF8, CF8,
- 37273 /* 67 - F9 */ F9, SF9, AF9, AF9, ASF9, CF9,
- 37274 /* 68 - F10 */ F10, SF10, AF10, AF10, ASF10, CF10,
- 37275 /* 69 - NumLock */ NLOCK, NLOCK, NLOCK, NLOCK, NLOCK, NLOCK,
- 37276 /* 70 - ScrLock */ SLOCK, SLOCK, SLOCK, SLOCK, SLOCK, SLOCK,
- 37277 /* 71 - Home */ HOME, '7', AHOME, AHOME, '7', CHOME,
- 37278 /* 72 - CurUp */ UP, '8', AUP, AUP, '8', CUP,
- 37279 /* 73 - PgUp */ PGUP, '9', APGUP, APGUP, '9', CPGUP,
- 37280 /* 74 - '-' */ NMIN, '-', ANMIN, ANMIN, '-', CNMIN,
- 37281 /* 75 - Left */ LEFT, '4', ALEFT, ALEFT, '4', CLEFT,
- 37282 /* 76 - MID */ MID, '5', AMID, AMID, '5', CMID,
- 37283 /* 77 - Right */ RIGHT, '6', ARIGHT, ARIGHT, '6', CRIGHT,
- 37284 /* 78 - '+' */ PLUS, '+', APLUS, APLUS, '+', CPLUS,
- 37285 /* 79 - End */ END, '1', AEND, AEND, '1', CEND,
- 37286 /* 80 - Down */ DOWN, '2', ADOWN, ADOWN, '2', CDOWN,
- 37287 /* 81 - PgDown */ PGDN, '3', APGDN, APGDN, '3', CPGDN,
- 37288 /* 82 - Insert */ INSRT, '0', AINSRT, AINSRT, '0', CINSRT,
- 37289 /* 83 - Delete */ 0177, '.', A(0177),0177, '.', 0177,
- 37290 /* 84 - Enter */ C('M'), C('M'), CA('M'),C('M'), C('M'), C('J'),
- 37291 /* 85 - ??? */ 0, 0, 0, 0, 0, 0,
- 37292 /* 86 - ??? */ '<', '>', A('<'), '|', '>', C('@'),
- 37293 /* 87 - F11 */ F11, SF11, AF11, AF11, ASF11, CF11,
- 37294 /* 88 - F12 */ F12, SF12, AF12, AF12, ASF12, CF12,
- 37295 /* 89 - ??? */ 0, 0, 0, 0, 0, 0,
- 37296 /* 90 - ??? */ 0, 0, 0, 0, 0, 0,
- 37297 /* 91 - ??? */ 0, 0, 0, 0, 0, 0,
- 37298 /* 92 - ??? */ 0, 0, 0, 0, 0, 0,
- 37299 /* 93 - ??? */ 0, 0, 0, 0, 0, 0,
- 37300 /* 94 - ??? */ 0, 0, 0, 0, 0, 0,
- 37301 /* 95 - ??? */ 0, 0, 0, 0, 0, 0,
- 37302 /* 96 - EXT_KEY */ EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY,
- 37303 /* 97 - ??? */ 0, 0, 0, 0, 0, 0,
- 37304 /* 98 - ??? */ 0, 0, 0, 0, 0, 0,
- 37305 /* 99 - ??? */ 0, 0, 0, 0, 0, 0,
- 37306 /*100 - ??? */ 0, 0, 0, 0, 0, 0,
- 37307 /*101 - ??? */ 0, 0, 0, 0, 0, 0,
- 37308 /*102 - ??? */ 0, 0, 0, 0, 0, 0,
- 37309 /*103 - ??? */ 0, 0, 0, 0, 0, 0,
- 37310 /*104 - ??? */ 0, 0, 0, 0, 0, 0,
- 37311 /*105 - ??? */ 0, 0, 0, 0, 0, 0,
- 37312 /*106 - ??? */ 0, 0, 0, 0, 0, 0,
- 37313 /*107 - ??? */ 0, 0, 0, 0, 0, 0,
- 37314 /*108 - ??? */ 0, 0, 0, 0, 0, 0,
- 37315 /*109 - ??? */ 0, 0, 0, 0, 0, 0,
- 37316 /*110 - ??? */ 0, 0, 0, 0, 0, 0,
- 37317 /*111 - ??? */ 0, 0, 0, 0, 0, 0,
- 37318 /*112 - ??? */ 0, 0, 0, 0, 0, 0,
- 37319 /*113 - ??? */ 0, 0, 0, 0, 0, 0,
- 37320 /*114 - ??? */ 0, 0, 0, 0, 0, 0,
- 37321 /*115 - ??? */ 0, 0, 0, 0, 0, 0,
- 37322 /*116 - ??? */ 0, 0, 0, 0, 0, 0,
- 37323 /*117 - ??? */ 0, 0, 0, 0, 0, 0,
- 37324 /*118 - ??? */ 0, 0, 0, 0, 0, 0,
- 37325 /*119 - ??? */ 0, 0, 0, 0, 0, 0,
- 37326 /*120 - ??? */ 0, 0, 0, 0, 0, 0,
- 37327 /*121 - ??? */ 0, 0, 0, 0, 0, 0,
- 37328 /*122 - ??? */ 0, 0, 0, 0, 0, 0,
- 37329 /*123 - ??? */ 0, 0, 0, 0, 0, 0,
- 37330 /*124 - ??? */ 0, 0, 0, 0, 0, 0,
- 37331 /*125 - ??? */ 0, 0, 0, 0, 0, 0,
- 37332 /*126 - ??? */ 0, 0, 0, 0, 0, 0,
- 37333 /*127 - ??? */ 0, 0, 0, 0, 0, 0
- 37334 };
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/keymaps/italian.src
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 37400 /*unchecked!*/
- 37401 /* Keymap for Italian MF-2 keyboard. */
- 37402
- 37403 u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
- 37404
- 37405 /* scan-code !Shift Shift Alt AltGr Alt+Sh Ctrl */
- 37406 /* ==================================================================== */
- 37407 /* 00 - none */ 0, 0, 0, 0, 0, 0,
- 37408 /* 01 - ESC */ C('['), C('['), CA('['),C('['), C('['), C('['),
- 37409 /* 02 - '1' */ '1', '!', A('1'), '1', '!', C('A'),
- 37410 /* 03 - '2' */ '2', '"', A('2'), '2', '@', C('@'),
- 37411 /* 04 - '3' */ '3', 0234, A('3'), '3', 0234, C('C'),
- 37412 /* 05 - '4' */ '4', '$', A('4'), '4', '$', C('D'),
- 37413 /* 06 - '5' */ '5', '%', A('5'), '5', '%', C('E'),
- 37414 /* 07 - '6' */ '6', '&', A('6'), '6', '&', C('F'),
- 37415 /* 08 - '7' */ '7', '/', A('7'), '7', '/', C('G'),
- 37416 /* 09 - '8' */ '8', '(', A('8'), '8', '(', C('H'),
- 37417 /* 10 - '9' */ '9', ')', A('9'), '8', ')', C('I'),
- 37418 /* 11 - '0' */ '0', '=', A('0'), '0', '=', C('@'),
- 37419 /* 12 - '-' */ ''', '?', A('''),''', '?', C('@'),
- 37420 /* 13 - '=' */ '|', '^', A('|'), '|', '^', C('^'),
- 37421 /* 14 - BS */ C('H'), C('H'), CA('H'),C('H'), C('H'), 0177,
- 37422 /* 15 - TAB */ C('I'), C('I'), CA('I'),C('I'), C('I'), C('I'),
- 37423 /* 16 - 'q' */ L('q'), 'Q', A('q'), 'q', 'Q', C('Q'),
- 37424 /* 17 - 'w' */ L('w'), 'W', A('w'), 'w', 'W', C('W'),
- 37425 /* 18 - 'e' */ L('e'), 'E', A('e'), 'e', 'E', C('E'),
- 37426 /* 19 - 'r' */ L('r'), 'R', A('r'), 'r', 'R', C('R'),
- 37427 /* 20 - 't' */ L('t'), 'T', A('t'), 't', 'T', C('T'),
- 37428 /* 21 - 'y' */ L('y'), 'Y', A('y'), 'y', 'Y', C('Y'),
- 37429 /* 22 - 'u' */ L('u'), 'U', A('u'), 'u', 'U', C('U'),
- 37430 /* 23 - 'i' */ L('i'), 'I', A('i'), 'i', 'I', C('I'),
- 37431 /* 24 - 'o' */ L('o'), 'O', A('o'), 'o', 'O', C('O'),
- 37432 /* 25 - 'p' */ L('p'), 'P', A('p'), 'p', 'P', C('P'),
- 37433 /* 26 - '[' */ 0212, 0202, 0212, '[', '{', C('['),
- 37434 /* 27 - ']' */ '+', '*', A('+'), ']', '}', C(']'),
- 37435 /* 28 - CR/LF */ C('M'), C('M'), CA('M'),C('M'), C('M'), C('J'),
- 37436 /* 29 - Ctrl */ CTRL, CTRL, CTRL, CTRL, CTRL, CTRL,
- 37437 /* 30 - 'a' */ L('a'), 'A', A('a'), 'a', 'A', C('A'),
- 37438 /* 31 - 's' */ L('s'), 'S', A('s'), 's', 'S', C('S'),
- 37439 /* 32 - 'd' */ L('d'), 'D', A('d'), 'd', 'D', C('D'),
- 37440 /* 33 - 'f' */ L('f'), 'F', A('f'), 'f', 'F', C('F'),
- 37441 /* 34 - 'g' */ L('g'), 'G', A('g'), 'g', 'G', C('G'),
- 37442 /* 35 - 'h' */ L('h'), 'H', A('h'), 'h', 'H', C('H'),
- 37443 /* 36 - 'j' */ L('j'), 'J', A('j'), 'j', 'J', C('J'),
- 37444 /* 37 - 'k' */ L('k'), 'K', A('k'), 'k', 'K', C('K'),
- 37445 /* 38 - 'l' */ L('l'), 'L', A('l'), 'l', 'L', C('L'),
- 37446 /* 39 - ';' */ 0225, '@', 0225, 0225, '@', C('@'),
- 37447 /* 40 - ''' */ 0205, '#', 0205, 0205, '#', C('@'),
- 37448 /* 41 - '`' */ '<', '>', A('<'), '\', '|', C('\'),
- 37449 /* 42 - l. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37450 /* 43 - '\' */ 0227, 025, 0227, 0227, 025, C('@'),
- 37451 /* 44 - 'z' */ L('z'), 'Z', A('z'), 'z', 'Z', C('Z'),
- 37452 /* 45 - 'x' */ L('x'), 'X', A('x'), 'x', 'X', C('X'),
- 37453 /* 46 - 'c' */ L('c'), 'C', A('c'), 'c', 'C', C('C'),
- 37454 /* 47 - 'v' */ L('v'), 'V', A('v'), 'v', 'V', C('V'),
- 37455 /* 48 - 'b' */ L('b'), 'B', A('b'), 'b', 'B', C('B'),
- 37456 /* 49 - 'n' */ L('n'), 'N', A('n'), 'n', 'N', C('N'),
- 37457 /* 50 - 'm' */ L('m'), 'M', A('m'), 'm', 'M', C('M'),
- 37458 /* 51 - ',' */ ',', ';', A(','), ',', ';', C('@'),
- 37459 /* 52 - '.' */ '.', ':', A('.'), '.', ':', C('@'),
- 37460 /* 53 - '/' */ '-', '_', A('-'), '-', '_', C('_'),
- 37461 /* 54 - r. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37462 /* 55 - '*' */ '*', '*', A('*'), '*', '*', C('M'),
- 37463 /* 56 - ALT */ ALT, ALT, ALT, ALT, ALT, ALT,
- 37464 /* 57 - ' ' */ ' ', ' ', A(' '), ' ', ' ', C('@'),
- 37465 /* 58 - CapsLck */ CALOCK, CALOCK, CALOCK, CALOCK, CALOCK, CALOCK,
- 37466 /* 59 - F1 */ F1, SF1, AF1, AF1, ASF1, CF1,
- 37467 /* 60 - F2 */ F2, SF2, AF2, AF2, ASF2, CF2,
- 37468 /* 61 - F3 */ F3, SF3, AF3, AF3, ASF3, CF3,
- 37469 /* 62 - F4 */ F4, SF4, AF4, AF4, ASF4, CF4,
- 37470 /* 63 - F5 */ F5, SF5, AF5, AF5, ASF5, CF5,
- 37471 /* 64 - F6 */ F6, SF6, AF6, AF6, ASF6, CF6,
- 37472 /* 65 - F7 */ F7, SF7, AF7, AF7, ASF7, CF7,
- 37473 /* 66 - F8 */ F8, SF8, AF8, AF8, ASF8, CF8,
- 37474 /* 67 - F9 */ F9, SF9, AF9, AF9, ASF9, CF9,
- 37475 /* 68 - F10 */ F10, SF10, AF10, AF10, ASF10, CF10,
- 37476 /* 69 - NumLock */ NLOCK, NLOCK, NLOCK, NLOCK, NLOCK, NLOCK,
- 37477 /* 70 - ScrLock */ SLOCK, SLOCK, SLOCK, SLOCK, SLOCK, SLOCK,
- 37478 /* 71 - Home */ HOME, '7', AHOME, AHOME, '7', CHOME,
- 37479 /* 72 - CurUp */ UP, '8', AUP, AUP, '8', CUP,
- 37480 /* 73 - PgUp */ PGUP, '9', APGUP, APGUP, '9', CPGUP,
- 37481 /* 74 - '-' */ NMIN, '-', ANMIN, ANMIN, '-', CNMIN,
- 37482 /* 75 - Left */ LEFT, '4', ALEFT, ALEFT, '4', CLEFT,
- 37483 /* 76 - MID */ MID, '5', AMID, AMID, '5', CMID,
- 37484 /* 77 - Right */ RIGHT, '6', ARIGHT, ARIGHT, '6', CRIGHT,
- 37485 /* 78 - '+' */ PLUS, '+', APLUS, APLUS, '+', CPLUS,
- 37486 /* 79 - End */ END, '1', AEND, AEND, '1', CEND,
- 37487 /* 80 - Down */ DOWN, '2', ADOWN, ADOWN, '2', CDOWN,
- 37488 /* 81 - PgDown */ PGDN, '3', APGDN, APGDN, '3', CPGDN,
- 37489 /* 82 - Insert */ INSRT, '0', AINSRT, AINSRT, '0', CINSRT,
- 37490 /* 83 - Delete */ 0177, '.', A(0177),0177, '.', 0177,
- 37491 /* 84 - Enter */ C('M'), C('M'), CA('M'),C('M'), C('M'), C('J'),
- 37492 /* 85 - ??? */ 0, 0, 0, 0, 0, 0,
- 37493 /* 86 - ??? */ '<', '>', A('<'), '|', '>', C('@'),
- 37494 /* 87 - F11 */ F11, SF11, AF11, AF11, ASF11, CF11,
- 37495 /* 88 - F12 */ F12, SF12, AF12, AF12, ASF12, CF12,
- 37496 /* 89 - ??? */ 0, 0, 0, 0, 0, 0,
- 37497 /* 90 - ??? */ 0, 0, 0, 0, 0, 0,
- 37498 /* 91 - ??? */ 0, 0, 0, 0, 0, 0,
- 37499 /* 92 - ??? */ 0, 0, 0, 0, 0, 0,
- 37500 /* 93 - ??? */ 0, 0, 0, 0, 0, 0,
- 37501 /* 94 - ??? */ 0, 0, 0, 0, 0, 0,
- 37502 /* 95 - ??? */ 0, 0, 0, 0, 0, 0,
- 37503 /* 96 - EXT_KEY */ EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY,
- 37504 /* 97 - ??? */ 0, 0, 0, 0, 0, 0,
- 37505 /* 98 - ??? */ 0, 0, 0, 0, 0, 0,
- 37506 /* 99 - ??? */ 0, 0, 0, 0, 0, 0,
- 37507 /*100 - ??? */ 0, 0, 0, 0, 0, 0,
- 37508 /*101 - ??? */ 0, 0, 0, 0, 0, 0,
- 37509 /*102 - ??? */ 0, 0, 0, 0, 0, 0,
- 37510 /*103 - ??? */ 0, 0, 0, 0, 0, 0,
- 37511 /*104 - ??? */ 0, 0, 0, 0, 0, 0,
- 37512 /*105 - ??? */ 0, 0, 0, 0, 0, 0,
- 37513 /*106 - ??? */ 0, 0, 0, 0, 0, 0,
- 37514 /*107 - ??? */ 0, 0, 0, 0, 0, 0,
- 37515 /*108 - ??? */ 0, 0, 0, 0, 0, 0,
- 37516 /*109 - ??? */ 0, 0, 0, 0, 0, 0,
- 37517 /*110 - ??? */ 0, 0, 0, 0, 0, 0,
- 37518 /*111 - ??? */ 0, 0, 0, 0, 0, 0,
- 37519 /*112 - ??? */ 0, 0, 0, 0, 0, 0,
- 37520 /*113 - ??? */ 0, 0, 0, 0, 0, 0,
- 37521 /*114 - ??? */ 0, 0, 0, 0, 0, 0,
- 37522 /*115 - ??? */ 0, 0, 0, 0, 0, 0,
- 37523 /*116 - ??? */ 0, 0, 0, 0, 0, 0,
- 37524 /*117 - ??? */ 0, 0, 0, 0, 0, 0,
- 37525 /*118 - ??? */ 0, 0, 0, 0, 0, 0,
- 37526 /*119 - ??? */ 0, 0, 0, 0, 0, 0,
- 37527 /*120 - ??? */ 0, 0, 0, 0, 0, 0,
- 37528 /*121 - ??? */ 0, 0, 0, 0, 0, 0,
- 37529 /*122 - ??? */ 0, 0, 0, 0, 0, 0,
- 37530 /*123 - ??? */ 0, 0, 0, 0, 0, 0,
- 37531 /*124 - ??? */ 0, 0, 0, 0, 0, 0,
- 37532 /*125 - ??? */ 0, 0, 0, 0, 0, 0,
- 37533 /*126 - ??? */ 0, 0, 0, 0, 0, 0,
- 37534 /*127 - ??? */ 0, 0, 0, 0, 0, 0
- 37535 };
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/keymaps/japanese.src
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 37600 /*
- 37601 * Keymap for Japanese 106 keyboard.
- 37602 * Dec. 31 1995
- 37603 * Toshiya Ogawa <ogw@shizuokanet.or.jp>
- 37604 * <GCD02425@niftyserve.or.jp>
- 37605 */
- 37606
- 37607 /*
- 37608 * Japanese 106 keyboard has following additional 5 scan codes
- 37609 * compared to US standard 101 keyboard.
- 37610 *
- 37611 * scan-code keytop effect in this keymap
- 37612 * -------------------------------------------------------
- 37613 * 112(0x70) KANA (ignored)
- 37614 * 115(0x73) BackSlash mapped to '\' and '_'
- 37615 * 121(0x79) HENKAN (ignored)
- 37616 * 123(0x7B) MU-HENKAN (ignored)
- 37617 * 125(0x7D) YEN mapped to '\' and '|'
- 37618 */
- 37619
- 37620 #if (NR_SCAN_CODES != 0x80)
- 37621 #error NR_SCAN_CODES mis-match
- 37622 #endif
- 37623
- 37624 u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
- 37625
- 37626 /* scan-code !Shift Shift Alt1 Alt2 Alt+Sh Ctrl */
- 37627 /* ==================================================================== */
- 37628 /* 00 - none */ 0, 0, 0, 0, 0, 0,
- 37629 /* 01 - ESC */ C('['), C('['), CA('['),CA('['),CA('['),C('['),
- 37630 /* 02 - '1' */ '1', '!', A('1'), A('1'), A('!'), C('A'),
- 37631 /* 03 - '2' */ '2', '"', A('2'), A('2'), A('"'), C('B'),
- 37632 /* 04 - '3' */ '3', '#', A('3'), A('3'), A('#'), C('C'),
- 37633 /* 05 - '4' */ '4', '$', A('4'), A('4'), A('$'), C('D'),
- 37634 /* 06 - '5' */ '5', '%', A('5'), A('5'), A('%'), C('E'),
- 37635 /* 07 - '6' */ '6', '&', A('6'), A('6'), A('&'), C('F'),
- 37636 /* 08 - '7' */ '7', ''', A('7'), A('7'), A('''),C('G'),
- 37637 /* 09 - '8' */ '8', '(', A('8'), A('8'), A('('), C('H'),
- 37638 /* 10 - '9' */ '9', ')', A('9'), A('9'), A(')'), C('I'),
- 37639 /* 11 - '0' */ '0', '~', A('0'), A('0'), A('~'), C('@'),
- 37640 /* 12 - '-' */ '-', '=', A('-'), A('-'), A('='), C('@'),
- 37641 /* 13 - '^' */ '^', '~', A('^'), A('^'), A('~'), C('^'),
- 37642 /* 14 - BS */ C('H'), C('H'), CA('H'),CA('H'),CA('H'),0177,
- 37643 /* 15 - TAB */ C('I'), C('I'), CA('I'),CA('I'),CA('I'),C('I'),
- 37644 /* 16 - 'q' */ L('q'), 'Q', A('q'), A('q'), A('Q'), C('Q'),
- 37645 /* 17 - 'w' */ L('w'), 'W', A('w'), A('w'), A('W'), C('W'),
- 37646 /* 18 - 'e' */ L('e'), 'E', A('e'), A('e'), A('E'), C('E'),
- 37647 /* 19 - 'r' */ L('r'), 'R', A('r'), A('r'), A('R'), C('R'),
- 37648 /* 20 - 't' */ L('t'), 'T', A('t'), A('t'), A('T'), C('T'),
- 37649 /* 21 - 'y' */ L('y'), 'Y', A('y'), A('y'), A('Y'), C('Y'),
- 37650 /* 22 - 'u' */ L('u'), 'U', A('u'), A('u'), A('U'), C('U'),
- 37651 /* 23 - 'i' */ L('i'), 'I', A('i'), A('i'), A('I'), C('I'),
- 37652 /* 24 - 'o' */ L('o'), 'O', A('o'), A('o'), A('O'), C('O'),
- 37653 /* 25 - 'p' */ L('p'), 'P', A('p'), A('p'), A('P'), C('P'),
- 37654 /* 26 - '@' */ '@', '`', A('@'), A('@'), A('`'), C('@'),
- 37655 /* 27 - '[' */ '[', '{', A('['), A('['), A('{'), C('['),
- 37656 /* 28 - Enter */ C('M'), C('M'), CA('M'),CA('M'),CA('M'),C('J'),
- 37657 /* 29 - Ctrl */ CTRL, CTRL, CTRL, CTRL, CTRL, CTRL,
- 37658 /* 30 - 'a' */ L('a'), 'A', A('a'), A('a'), A('A'), C('A'),
- 37659 /* 31 - 's' */ L('s'), 'S', A('s'), A('s'), A('S'), C('S'),
- 37660 /* 32 - 'd' */ L('d'), 'D', A('d'), A('d'), A('D'), C('D'),
- 37661 /* 33 - 'f' */ L('f'), 'F', A('f'), A('f'), A('F'), C('F'),
- 37662 /* 34 - 'g' */ L('g'), 'G', A('g'), A('g'), A('G'), C('G'),
- 37663 /* 35 - 'h' */ L('h'), 'H', A('h'), A('h'), A('H'), C('H'),
- 37664 /* 36 - 'j' */ L('j'), 'J', A('j'), A('j'), A('J'), C('J'),
- 37665 /* 37 - 'k' */ L('k'), 'K', A('k'), A('k'), A('K'), C('K'),
- 37666 /* 38 - 'l' */ L('l'), 'L', A('l'), A('l'), A('L'), C('L'),
- 37667 /* 39 - ';' */ ';', '+', A(';'), A(';'), A('+'), C('@'),
- 37668 /* 40 - ':' */ ':', '*', A(':'), A(':'), A('*'), C('@'),
- 37669 /* 41 - KANJI */ 0, 0, 0, 0, 0, 0,
- 37670 /* 42 - l. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37671 /* 43 - ']' */ ']', '}', A(']'), A(']'), A('}'), C(']'),
- 37672 /* 44 - 'z' */ L('z'), 'Z', A('z'), A('z'), A('Z'), C('Z'),
- 37673 /* 45 - 'x' */ L('x'), 'X', A('x'), A('x'), A('X'), C('X'),
- 37674 /* 46 - 'c' */ L('c'), 'C', A('c'), A('c'), A('C'), C('C'),
- 37675 /* 47 - 'v' */ L('v'), 'V', A('v'), A('v'), A('V'), C('V'),
- 37676 /* 48 - 'b' */ L('b'), 'B', A('b'), A('b'), A('B'), C('B'),
- 37677 /* 49 - 'n' */ L('n'), 'N', A('n'), A('n'), A('N'), C('N'),
- 37678 /* 50 - 'm' */ L('m'), 'M', A('m'), A('m'), A('M'), C('M'),
- 37679 /* 51 - ',' */ ',', '<', A(','), A(','), A('<'), C('@'),
- 37680 /* 52 - '.' */ '.', '>', A('.'), A('.'), A('>'), C('@'),
- 37681 /* 53 - '/' */ '/', '?', A('/'), A('/'), A('?'), C('@'),
- 37682 /* 54 - r. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT,
- 37683 /* 55 - '*' */ '*', '*', A('*'), A('*'), A('*'), C('@'),
- 37684 /* 56 - ALT */ ALT, ALT, ALT, ALT, ALT, ALT,
- 37685 /* 57 - ' ' */ ' ', ' ', A(' '), A(' '), A(' '), C('@'),
- 37686 /* 58 - CapsLck */ CALOCK, CALOCK, CALOCK, CALOCK, CALOCK, CALOCK,
- 37687 /* 59 - F1 */ F1, SF1, AF1, AF1, ASF1, CF1,
- 37688 /* 60 - F2 */ F2, SF2, AF2, AF2, ASF2, CF2,
- 37689 /* 61 - F3 */ F3, SF3, AF3, AF3, ASF3, CF3,
- 37690 /* 62 - F4 */ F4, SF4, AF4, AF4, ASF4, CF4,
- 37691 /* 63 - F5 */ F5, SF5, AF5, AF5, ASF5, CF5,
- 37692 /* 64 - F6 */ F6, SF6, AF6, AF6, ASF6, CF6,
- 37693 /* 65 - F7 */ F7, SF7, AF7, AF7, ASF7, CF7,
- 37694 /* 66 - F8 */ F8, SF8, AF8, AF8, ASF8, CF8,
- 37695 /* 67 - F9 */ F9, SF9, AF9, AF9, ASF9, CF9,
- 37696 /* 68 - F10 */ F10, SF10, AF10, AF10, ASF10, CF10,
- 37697 /* 69 - NumLock */ NLOCK, NLOCK, NLOCK, NLOCK, NLOCK, NLOCK,
- 37698 /* 70 - ScrLock */ SLOCK, SLOCK, SLOCK, SLOCK, SLOCK, SLOCK,
- 37699 /* 71 - Home */ HOME, '7', AHOME, AHOME, A('7'), CHOME,
- 37700 /* 72 - CurUp */ UP, '8', AUP, AUP, A('8'), CUP,
- 37701 /* 73 - PgUp */ PGUP, '9', APGUP, APGUP, A('9'), CPGUP,
- 37702 /* 74 - '-' */ NMIN, '-', ANMIN, ANMIN, A('-'), CNMIN,
- 37703 /* 75 - Left */ LEFT, '4', ALEFT, ALEFT, A('4'), CLEFT,
- 37704 /* 76 - MID */ MID, '5', AMID, AMID, A('5'), CMID,
- 37705 /* 77 - Right */ RIGHT, '6', ARIGHT, ARIGHT, A('6'), CRIGHT,
- 37706 /* 78 - '+' */ PLUS, '+', APLUS, APLUS, A('+'), CPLUS,
- 37707 /* 79 - End */ END, '1', AEND, AEND, A('1'), CEND,
- 37708 /* 80 - Down */ DOWN, '2', ADOWN, ADOWN, A('2'), CDOWN,
- 37709 /* 81 - PgDown */ PGDN, '3', APGDN, APGDN, A('3'), CPGDN,
- 37710 /* 82 - Insert */ INSRT, '0', AINSRT, AINSRT, A('0'), CINSRT,
- 37711 /* 83 - Delete */ 0177, '.', A(0177),A(0177),A('.'), 0177,
- 37712 /* 84 - Enter */ C('M'), C('M'), CA('M'),CA('M'),CA('M'),C('J'),
- 37713 /* 85 - ??? */ 0, 0, 0, 0, 0, 0,
- 37714 /* 86 - ??? */ 0, 0, 0, 0, 0, 0,
- 37715 /* 87 - F11 */ F11, SF11, AF11, AF11, ASF11, CF11,
- 37716 /* 88 - F12 */ F12, SF12, AF12, AF12, ASF12, CF12,
- 37717 /* 89 - ??? */ 0, 0, 0, 0, 0, 0,
- 37718 /* 90 - ??? */ 0, 0, 0, 0, 0, 0,
- 37719 /* 91 - ??? */ 0, 0, 0, 0, 0, 0,
- 37720 /* 92 - ??? */ 0, 0, 0, 0, 0, 0,
- 37721 /* 93 - ??? */ 0, 0, 0, 0, 0, 0,
- 37722 /* 94 - ??? */ 0, 0, 0, 0, 0, 0,
- 37723 /* 95 - ??? */ 0, 0, 0, 0, 0, 0,
- 37724 /* 96 - EXT_KEY */ EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY,
- 37725 /* 97 - ??? */ 0, 0, 0, 0, 0, 0,
- 37726 /* 98 - ??? */ 0, 0, 0, 0, 0, 0,
- 37727 /* 99 - ??? */ 0, 0, 0, 0, 0, 0,
- 37728 /*100 - ??? */ 0, 0, 0, 0, 0, 0,
- 37729 /*101 - ??? */ 0, 0, 0, 0, 0, 0,
- 37730 /*102 - ??? */ 0, 0, 0, 0, 0, 0,
- 37731 /*103 - ??? */ 0, 0, 0, 0, 0, 0,
- 37732 /*104 - ??? */ 0, 0, 0, 0, 0, 0,
- 37733 /*105 - ??? */ 0, 0, 0, 0, 0, 0,
- 37734 /*106 - ??? */ 0, 0, 0, 0, 0, 0,
- 37735 /*107 - ??? */ 0, 0, 0, 0, 0, 0,
- 37736 /*108 - ??? */ 0, 0, 0, 0, 0, 0,
- 37737 /*109 - ??? */ 0, 0, 0, 0, 0, 0,
- 37738 /*110 - ??? */ 0, 0, 0, 0, 0, 0,
- 37739 /*111 - ??? */ 0, 0, 0, 0, 0, 0,
- 37740 /*112 - KANA */ 0, 0, 0, 0, 0, 0,
- 37741 /*113 - ??? */ 0, 0, 0, 0, 0, 0,
- 37742 /*114 - ??? */ 0, 0, 0, 0, 0, 0,
- 37743 /*115 - '\' */ '\', '_', A('\'),A('\'),A('_'), C('_'),
- 37744 /*116 - ??? */ 0, 0, 0, 0, 0, 0,
- 37745 /*117 - ??? */ 0, 0, 0, 0, 0, 0,
- 37746 /*118 - ??? */ 0, 0, 0, 0, 0, 0,
- 37747 /*119 - ??? */ 0, 0, 0, 0, 0, 0,
- 37748 /*120 - ??? */ 0, 0, 0, 0, 0, 0,
- 37749 /*121 - HENKAN */ 0, 0, 0, 0, 0, 0,
- 37750 /*122 - ??? */ 0, 0, 0, 0, 0, 0,
- 37751 /*123 - MU-HENKAN*/ 0, 0, 0, 0, 0, 0,
- 37752 /*124 - ??? */ 0, 0, 0, 0, 0, 0,
- 37753 /*125 - YEN */ '\', '|', A('\'),A('\'),A('|'), C('\'),
- 37754 /*126 - ??? */ 0, 0, 0, 0, 0, 0,
- 37755 /*127 - ??? */ 0, 0, 0, 0, 0, 0
- 37756 };
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/keymaps/latin-am.src
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- 37800 /***
- 37801 Keymap for Latin American keyboard. v1.02
- 37802 Victor A. Rodriguez - El bit Fantasma - Bit-Man@Tasa.Com.AR
- 37803
- 37804 The Latin American keyboard makes differences between the left and
- 37805 right ALT keys (the right one is so called ALT GR), and uses accent.
- 37806
- 37807 Release History
- 37808 ===============
- 37809 v1.00 Initial version
- 37810 v1.01 Extended ASCII characters replaced by hex. equivalents
- 37811 v1.02 NR_SCAN_CODES has grown to 0x80, required by Toshiya Ogawa
- 37812 (ogw@shizuokanet.or.jp) and added by Kees J.Bot (kjb@cs.vu.nl)
- 37813 in MINIX 1.7.2
- 37814 ***/
- 37815
- 37816 #if (NR_SCAN_CODES != 0x80)
- 37817 #error NR_SCAN_CODES mis-match
- 37818 #endif
- 37819
- 37820 u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
- 37821
- 37822 /* scan-code !Shift Shift Alt1 Alt2 Alt+Sh Ctrl */
- 37823 /* ==================================================================== */
- 37824 /* 00 - none */ 0, 0, 0, 0, 0, 0,
- 37825 /* 01 - ESC */ C('['), C('['), CA('['),CA('['),CA('['),C('['),
- 37826 /* 02 - '1' */ '1', '!', A('1'), A('1'), A('!'), C('A'),
- 37827 /* 03 - '2' */ '2', '"', A('2'), A('2'), A('"'), C('@'),
- 37828 /* 04 - '3' */ '3', '#', A('3'), A('3'), A('#'), C('C'),
- 37829 /* 05 - '4' */ '4', '$', A('4'), A('4'), A('$'), C('D'),
- 37830 /* 06 - '5' */ '5', '%', A('5'), A('5'), A('%'), C('E'),
- 37831 /* 07 - '6' */ '6', '&', A('6'), A('6'), A('$'), C('^'),
- 37832 /* 08 - '7' */ '7', '/', A('7'), A('7'), A('/'), C('G'),
- 37833 /* 09 - '8' */ '8', '(', A('8'), A('8'), A('('), C('H'),
- 37834 /* 10 - '9' */ '9', ')', A('9'), A('9'), A(')'), C('I'),
- 37835 /* 11 - '0' */ '0', '=', A('0'), A('0'), A('='), C('@'),
- 37836 /* 12 - '-' */ ''', '?', A('''), 0x5c, A('?'), C('?'),
- 37837 /* 13 - '