├── .dir-locals.el ├── .gdbinit.tmpl ├── .gitignore ├── BugsResolved.txt ├── CODING ├── DevLog_Lab4 ├── Assignment_Questionstxt ├── Hw5.txt ├── Hw6.txt ├── Hw7.txt └── lab4.txt ├── GNUmakefile ├── HawxNote.txt ├── README.md ├── README_BY_INSTRUCTOR ├── README_lab3 ├── boot ├── Makefrag ├── boot.S ├── main.c └── sign.pl ├── conf ├── env.mk └── lab.mk ├── gdbstart.txt ├── gitcmd.txt ├── grade-functions.sh ├── grade-lab1.sh ├── grade-lab2.sh ├── grade-lab3.sh ├── grade-lab4.sh ├── inc ├── COPYRIGHT ├── assert.h ├── elf.h ├── env.h ├── error.h ├── kbdreg.h ├── lib.h ├── memlayout.h ├── mmu.h ├── queue.h ├── stab.h ├── stdarg.h ├── stdio.h ├── string.h ├── syscall.h ├── trap.h ├── types.h └── x86.h ├── init.sh ├── kern ├── COPYRIGHT ├── Makefrag ├── console.c ├── console.h ├── cpu.h ├── entry.S ├── entrypgdir.c ├── env.c ├── env.h ├── genvect.py ├── init.c ├── kclock.c ├── kclock.h ├── kdebug.c ├── kdebug.h ├── kernel.ld ├── lapic.c ├── monitor.c ├── monitor.h ├── mpconfig.c ├── mpentry.S ├── picirq.c ├── picirq.h ├── pmap.c ├── pmap.h ├── printf.c ├── sched.c ├── sched.h ├── spinlock.c ├── spinlock.h ├── syscall.c ├── syscall.h ├── trap.c ├── trap.h └── trapentry.S ├── lib ├── Makefrag ├── console.c ├── entry.S ├── exit.c ├── fork.c ├── ipc.c ├── libmain.c ├── panic.c ├── pfentry.S ├── pgfault.c ├── printf.c ├── printfmt.c ├── readline.c ├── string.c └── syscall.c ├── mergedep.pl ├── qemu-bin ├── bin │ ├── qemu │ ├── qemu-ga │ ├── qemu-img │ ├── qemu-io │ ├── qemu-nbd │ ├── qemu-system-arm │ └── qemu-system-x86_64 ├── etc │ └── qemu │ │ └── target-x86_64.conf └── share │ ├── doc │ └── qemu │ │ ├── qemu-doc.html │ │ └── qemu-tech.html │ ├── man │ ├── man1 │ │ ├── qemu-img.1 │ │ └── qemu.1 │ └── man8 │ │ └── qemu-nbd.8 │ └── qemu │ ├── bamboo.dtb │ ├── bios.bin │ ├── keymaps │ ├── ar │ ├── common │ ├── da │ ├── de │ ├── de-ch │ ├── en-gb │ ├── en-us │ ├── es │ ├── et │ ├── fi │ ├── fo │ ├── fr │ ├── fr-be │ ├── fr-ca │ ├── fr-ch │ ├── hr │ ├── hu │ ├── is │ ├── it │ ├── ja │ ├── lt │ ├── lv │ ├── mk │ ├── modifiers │ ├── nl │ ├── nl-be │ ├── no │ ├── pl │ ├── pt │ ├── pt-br │ ├── ru │ ├── sl │ ├── sv │ ├── th │ └── tr │ ├── linuxboot.bin │ ├── mpc8544ds.dtb │ ├── multiboot.bin │ ├── openbios-ppc │ ├── openbios-sparc32 │ ├── openbios-sparc64 │ ├── petalogix-ml605.dtb │ ├── petalogix-s3adsp1800.dtb │ ├── ppc_rom.bin │ ├── pxe-e1000.rom │ ├── pxe-eepro100.rom │ ├── pxe-ne2k_pci.rom │ ├── pxe-pcnet.rom │ ├── pxe-rtl8139.rom │ ├── pxe-virtio.rom │ ├── s390-zipl.rom │ ├── slof.bin │ ├── spapr-rtas.bin │ ├── vgabios-cirrus.bin │ ├── vgabios-qxl.bin │ ├── vgabios-stdvga.bin │ ├── vgabios-vmware.bin │ └── vgabios.bin ├── upcode_util ├── Arg_split.py ├── cscope.sh ├── indent.sh └── listKeywordFile.py └── user ├── Makefrag ├── badsegment.c ├── breakpoint.c ├── buggyhello.c ├── buggyhello2.c ├── divzero.c ├── dumbfork.c ├── evilhello.c ├── fairness.c ├── faultalloc.c ├── faultallocbad.c ├── faultbadhandler.c ├── faultdie.c ├── faultevilhandler.c ├── faultnostack.c ├── faultread.c ├── faultreadkernel.c ├── faultregs.c ├── faultwrite.c ├── faultwritekernel.c ├── forktree.c ├── hello.c ├── idle.c ├── pingpong.c ├── pingpongs.c ├── primes.c ├── softint.c ├── spin.c ├── stresssched.c ├── testbss.c ├── user.ld └── yield.c /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((nil 2 | (indent-tabs-mode . t) 3 | (tab-width . 8)) 4 | (c-mode 5 | (c-file-style . "bsd") 6 | (c-basic-offset . 8)) 7 | (shell-mode 8 | (sh-basic-offset . 8) 9 | (sh-indentation . 8)) 10 | ) 11 | -------------------------------------------------------------------------------- /.gdbinit.tmpl: -------------------------------------------------------------------------------- 1 | set $lastcs = -1 2 | 3 | define hook-stop 4 | # There doesn't seem to be a good way to detect if we're in 16- or 5 | # 32-bit mode, but we always run with CS == 8 in 32-bit mode. 6 | if $cs == 8 || $cs == 27 7 | if $lastcs != 8 && $lastcs != 27 8 | set architecture i386 9 | end 10 | x/i $pc 11 | else 12 | if $lastcs == -1 || $lastcs == 8 || $lastcs == 27 13 | set architecture i8086 14 | end 15 | # Translate the segment:offset into a physical address 16 | printf "[%4x:%4x] ", $cs, $eip 17 | x/i $cs*16+$eip 18 | end 19 | set $lastcs = $cs 20 | end 21 | 22 | echo + target remote localhost:1234\n 23 | target remote localhost:1234 24 | 25 | # If this fails, it's probably because your GDB doesn't support ELF. 26 | # Look at the tools page at 27 | # http://pdos.csail.mit.edu/6.828/2009/tools.html 28 | # for instructions on building GDB with ELF support. 29 | echo + symbol-file obj/kern/kernel\n 30 | symbol-file obj/kern/kernel 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /obj 2 | /jos.in 3 | /jos.log 4 | /jos.out 5 | /jos.out.* 6 | /jos.cmd 7 | /.gdbinit 8 | /wget.log 9 | /slirp.cap 10 | /qemu.out 11 | /qemu.log 12 | /lab?-handin.tar.gz 13 | /lab?/ 14 | /sol?/ 15 | /conf/lab.mk 16 | -------------------------------------------------------------------------------- /BugsResolved.txt: -------------------------------------------------------------------------------- 1 | 1. Misuse of region_alloc V.S. memset V.S memmove 2 | if(NIL == (pte = region_alloc(e, (void*)ph->p_va, ph->p_memsz))) 3 | { 4 | panic("pte not found!?\n"); 5 | return ; 6 | } 7 | *pte = *pte | PTE_U | PTE_W; 8 | memset((void*)ROUNDDOWN(ph->p_va,PGSIZE),0 ,PGSIZE); 9 | memmove((void*)ph->p_va, (void*)((uint8_t*)binary + ph->p_offset), ph->p_filesz); 10 | The list to be clarified 11 | A. region_alloc is to setup memory in sequence pages. 12 | B. pte just get only one page! 13 | just set one page's privilege to PTE_U, PTE_W. 14 | C. If memmove will use the size than one page, then it will raise fault by CPU! 15 | Becuase the other PTEs(not the pte just get!) were not in the right privilege. 16 | 17 | 2. load_icode' lcr3' setup 18 | A. lcr3 uses the physical address! 19 | B. lcr3's right setup posistion! 20 | Before the time that all the memory you want to chage! 21 | 22 | 3. stack's growth direction 23 | memset((void*)(e->env_tf.tf_esp - PGSIZE),0 ,PGSIZE);))) 24 | Error : e->env_tf.tf_esp = USTACKTOP-PGSIZE; 25 | Right : e->env_tf.tf_esp = USTACKTOP; 26 | push : 27 | var = stack[esp-4] 28 | esp = esp - 4 29 | 30 | pop : 31 | var = stack[esp] 32 | esp = esp + 4 33 | 34 | 4. boot_map_region 35 | It should at least have the permissions that lower lever PTE has. 36 | -------------------------------------------------------------------------------- /CODING: -------------------------------------------------------------------------------- 1 | JOS CODING STANDARDS 2 | 3 | It's easier on everyone if all authors working on a shared 4 | code base are consistent in the way they write their programs. 5 | We have the following conventions in our code: 6 | 7 | * No space after the name of a function in a call 8 | For example, printf("hello") not printf ("hello"). 9 | 10 | * One space after keywords "if", "for", "while", "switch". 11 | For example, if (x) not if(x). 12 | 13 | * Space before braces. 14 | For example, if (x) { not if (x){. 15 | 16 | * Function names are all lower-case separated by underscores. 17 | 18 | * Beginning-of-line indentation via tabs, not spaces. 19 | 20 | * Preprocessor macros are always UPPERCASE. 21 | There are a few grandfathered exceptions: assert, panic, 22 | static_assert, offsetof. 23 | 24 | * Pointer types have spaces: (uint16_t *) not (uint16_t*). 25 | 26 | * Multi-word names are lower_case_with_underscores. 27 | 28 | * Comments in imported code are usually C /* ... */ comments. 29 | Comments in new code are C++ style //. 30 | 31 | * In a function definition, the function name starts a new line. 32 | Then you can grep -n '^foo' */*.c to find the definition of foo. 33 | 34 | * Functions that take no arguments are declared f(void) not f(). 35 | 36 | The included .dir-locals.el file will automatically set up the basic 37 | indentation style in Emacs. 38 | -------------------------------------------------------------------------------- /DevLog_Lab4/Assignment_Questionstxt: -------------------------------------------------------------------------------- 1 | 1.(After Exercise01) 2 | Compare kern/mpentry.S side by side with boot/boot.S. 3 | Bearing in mind that kern/mpentry.S is compiled and linked to run above KERNBASE just like everything else in the kernel 4 | , what is the purpose of macro MPBOOTPHYS? 5 | Why is it necessary in kern/mpentry.S but not in boot/boot.S? 6 | In other words, what could go wrong if it were omitted in kern/mpentry.S? 7 | Hint: recall the differences between the link address and the load address that we have discussed in Lab 1. 8 | ANS: 9 | #define MPBOOTPHYS(s) ((s) - mpentry_start + MPENTRY_PADDR)))) 10 | MPBOOTPHYS is to calculate symobl address relative to MPENTRY_PADDR. 11 | The ASM is executed in the load address above KERNBASE, but JOS need to run mp_main at 0x7000 address! 12 | Of course 0x7000's page is reserved at pmap.c. 13 | 14 | 2.(After Exercise04) 15 | It seems that using the big kernel lock guarantees that only one CPU can run the kernel code at a time. 16 | Why do we still need separate kernel stacks for each CPU? 17 | Describe a scenario in which using a shared kernel stack will go wrong 18 | , even with the protection of the big kernel lock. 19 | ANS: 20 | If it leaves future-needed data in the single kernel stack, 21 | It will have the re-entrant problem. 22 | 23 | 3.(After Exercise05) 24 | In your implementation of env_run() you should have called lcr3(). 25 | Before and after the call to lcr3(), your code makes references (at least it should) to the variable e, the argument to env_run. 26 | Upon loading the %cr3 register, the addressing context used by the MMU is instantly changed. 27 | But a virtual address (namely e) has meaning relative to a given address context 28 | --the address context specifies the physical address to which the virtual address maps. 29 | Why can the pointer e be dereferenced both before and after the addressing switch? 30 | ANS: 31 | Because Code Segment is in the Kernel Privilege, 32 | it still can access the kern_pgdir's part belonged to the kernel like environment e. 33 | -------------------------------------------------------------------------------- /DevLog_Lab4/Hw5.txt: -------------------------------------------------------------------------------- 1 | Submit1: 2 | 80104b01: acquire's panic 3 | 8010270d: ideintr's acquire 4 | 801063eb: trap's ideintr 5 | 80106161: alltrap's call trap 6 | Because It enables the INT by sti(), 7 | the atmoic operation should disable the correspondingCPU's INT to avoid same CPU enter the critical section. 8 | not to disable self processor's INT, as for the next HW INT to cause the likely-locking CPU to cause panic, acquire twice and seem like to success. 9 | 10 | -------------------------------------------------------------------------------- /DevLog_Lab4/Hw6.txt: -------------------------------------------------------------------------------- 1 | submit1: 2 | sched: "mostly"" executed on proc->context->kstack 3 | why switch to uvm 4 | need what varable? 5 | what doesn't comment mean? 6 | // Switch to chosen process. It is the process's job 7 | // to release ptable.lock and then reacquire it 8 | // before jumping back to us. 9 | 10 | Before waking up(From user to kernel), user's memory scope lock something. 11 | So unlock's action needed to be executed under user's memory scope. 12 | 13 | In the same way, when sched occured (sleeping : from user to kernel), 14 | It also has to switch to kvm. 15 | 16 | scheduler: executed on cpu->scheduler->kstack 17 | 18 | corutine: scheduler & sched 19 | 20 | When sched calls swtch, does that call to swtch() ever return? 21 | It won't return directly. It will return after scheduler pick the coressponding process to run. 22 | 23 | submit2: 24 | It could be done in various platform, just refrence wiki. 25 | Concrete examples or Argue why not? 26 | This Topic is constrained by CPU design. 27 | 28 | submit3: 29 | Normal pattern as corutine. 30 | adcb 31 | 32 | The very first pattern: ac 33 | cause: 34 | a---- mpmain->scheduler to make first user process run 35 | c---- first user process trigger the system call (yield), so print C 36 | after that ... follow the adcb pattern 37 | 38 | Discussion: 39 | Why switchuvm can access kernel varable? 40 | Becase CS is still in kernel permission. 41 | -------------------------------------------------------------------------------- /DevLog_Lab4/Hw7.txt: -------------------------------------------------------------------------------- 1 | Submit 2 | 1.no ptable.lock 3 | process' condition will be error! 4 | 5 | 2.no idelock 6 | iderw(1) Read iderw(2) Write 7 | | | 8 | | b->qnext = 0 9 | b->qnext = 0; | 10 | | | 11 | idestart() | 12 | | | 13 | idestart(); 14 | 15 | -------------------------------------------------------------------------------- /HawxNote.txt: -------------------------------------------------------------------------------- 1 | Problem: 2 | Note "Prob:" tag. 3 | 1. Why does lib/string.h have no prototype for memcpy? 4 | Platform dependent?! 5 | 6 | 2. Load ELF 7 | filesz memsz. 8 | load into address space: filesz 9 | Execute at address space: memsz 10 | How did the text work live in (extension)range memsz? 11 | alloc variables? 12 | 13 | 3. What's about UVPT for? 14 | UVPT is for what usage. 15 | Note UVPT use the the lec4. skill backpointer to itself. 16 | 17 | 4. Assume for this function that no two segments will touch 18 | the same virtual page. 19 | xv6 assume it, too. 20 | But if not, how did it map? 21 | 22 | 5. what's about the 'size' parameter for? 23 | env_create (uint8_t * binary, size_t size, enum EnvType type)) 24 | load_icode (struct Env *e, uint8_t * binary, size_t size)) 25 | 26 | 6. why can't I use gdb to browse some variables 27 | 28 | 7. why did it not have fs/gs? 29 | 30 | 8. If a page fault is caused by a page-level protection, 31 | the access flag in the page-directory is set when the fault occurs. 32 | 33 | 9.Differences about Call Gate/ Trap Gate/ Int Gat /Task Gate 34 | IDT must not contain Call Gate 35 | INT Gate will clear IF bit at eflag bit, but Trap Gate won't. 36 | 37 | 10. lib/entry.S 38 | // See if we were started with arguments on the stack 39 | cmpl $USTACKTOP, %esp 40 | jne args_exist 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Exokernel_Implementation 2 | I love OS. I implement it. 3 | 4 | According to the design principles from MIT's Exokernel, one of library OSes, I implemented this OS from scratch. 5 | 6 | I devised essential OS modules such as booting, Memory management, User-level environments, Preemptive multitasking and a sehll. 7 | -------------------------------------------------------------------------------- /README_lab3: -------------------------------------------------------------------------------- 1 | 2012/04/06 2 | Branch lab3 is created from master which is merged with lab2. 3 | -------------------------------------------------------------------------------- /boot/Makefrag: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile fragment for the JOS kernel. 3 | # This is NOT a complete makefile; 4 | # you must run GNU make in the top-level directory 5 | # where the GNUmakefile is located. 6 | # 7 | 8 | OBJDIRS += boot 9 | 10 | BOOT_OBJS := $(OBJDIR)/boot/boot.o $(OBJDIR)/boot/main.o 11 | 12 | $(OBJDIR)/boot/%.o: boot/%.c 13 | @echo + cc -Os $< 14 | @mkdir -p $(@D) 15 | $(V)$(CC) -nostdinc $(KERN_CFLAGS) -Os -c -o $@ $< 16 | 17 | $(OBJDIR)/boot/%.o: boot/%.S 18 | @echo + as $< 19 | @mkdir -p $(@D) 20 | $(V)$(CC) -nostdinc $(KERN_CFLAGS) -c -o $@ $< 21 | 22 | $(OBJDIR)/boot/main.o: boot/main.c 23 | @echo + cc -Os $< 24 | $(V)$(CC) -nostdinc $(KERN_CFLAGS) -Os -c -o $(OBJDIR)/boot/main.o boot/main.c 25 | 26 | $(OBJDIR)/boot/boot: $(BOOT_OBJS) 27 | @echo + ld boot/boot 28 | $(V)$(LD) $(LDFLAGS) -N -e start -Ttext 0x7C00 -o $@.out $^ 29 | $(V)$(OBJDUMP) -S $@.out >$@.asm 30 | $(V)$(OBJCOPY) -S -O binary -j .text $@.out $@ 31 | $(V)perl boot/sign.pl $(OBJDIR)/boot/boot 32 | 33 | -------------------------------------------------------------------------------- /boot/boot.S: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | # Start the CPU: switch to 32-bit protected mode, jump into C. 4 | # The BIOS loads this code from the first sector of the hard disk into 5 | # memory at physical address 0x7c00 and starts executing in real mode 6 | # with %cs=0 %ip=7c00. 7 | 8 | .set PROT_MODE_CSEG, 0x8 # kernel code segment selector 9 | .set PROT_MODE_DSEG, 0x10 # kernel data segment selector 10 | .set CR0_PE_ON, 0x1 # protected mode enable flag 11 | 12 | .globl start 13 | start: 14 | .code16 # Assemble for 16-bit mode 15 | cli # Disable interrupts 16 | cld # String operations increment 17 | 18 | # Set up the important data segment registers (DS, ES, SS). 19 | xorw %ax,%ax # Segment number zero 20 | movw %ax,%ds # -> Data Segment 21 | movw %ax,%es # -> Extra Segment 22 | movw %ax,%ss # -> Stack Segment 23 | 24 | # Enable A20: 25 | # For backwards compatibility with the earliest PCs, physical 26 | # address line 20 is tied low, so that addresses higher than 27 | # 1MB wrap around to zero by default. This code undoes this. 28 | seta20.1: 29 | inb $0x64,%al # Wait for not busy 30 | testb $0x2,%al 31 | jnz seta20.1 32 | 33 | movb $0xd1,%al # 0xd1 -> port 0x64 34 | outb %al,$0x64 35 | 36 | seta20.2: 37 | inb $0x64,%al # Wait for not busy 38 | testb $0x2,%al 39 | jnz seta20.2 40 | 41 | movb $0xdf,%al # 0xdf -> port 0x60 42 | outb %al,$0x60 43 | 44 | # Switch from real to protected mode, using a bootstrap GDT 45 | # and segment translation that makes virtual addresses 46 | # identical to their physical addresses, so that the 47 | # effective memory map does not change during the switch. 48 | lgdt gdtdesc 49 | movl %cr0, %eax 50 | orl $CR0_PE_ON, %eax 51 | movl %eax, %cr0 52 | 53 | # Jump to next instruction, but in 32-bit code segment. 54 | # Switches processor into 32-bit mode. 55 | ljmp $PROT_MODE_CSEG, $protcseg 56 | 57 | .code32 # Assemble for 32-bit mode 58 | protcseg: 59 | # Set up the protected-mode data segment registers 60 | movw $PROT_MODE_DSEG, %ax # Our data segment selector 61 | movw %ax, %ds # -> DS: Data Segment 62 | movw %ax, %es # -> ES: Extra Segment 63 | movw %ax, %fs # -> FS 64 | movw %ax, %gs # -> GS 65 | movw %ax, %ss # -> SS: Stack Segment 66 | 67 | # Set up the stack pointer and call into C. 68 | movl $start, %esp 69 | call bootmain 70 | 71 | # If bootmain returns (it shouldn't), loop. 72 | spin: 73 | jmp spin 74 | 75 | # Bootstrap GDT 76 | .p2align 2 # force 4 byte alignment 77 | gdt: 78 | SEG_NULL # null seg 79 | SEG(STA_X|STA_R, 0x0, 0xffffffff) # code seg 80 | SEG(STA_W, 0x0, 0xffffffff) # data seg 81 | 82 | gdtdesc: 83 | .word 0x17 # sizeof(gdt) - 1 84 | .long gdt # address gdt 85 | 86 | -------------------------------------------------------------------------------- /boot/sign.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | open(BB, $ARGV[0]) || die "open $ARGV[0]: $!"; 4 | 5 | binmode BB; 6 | my $buf; 7 | read(BB, $buf, 1000); 8 | $n = length($buf); 9 | 10 | if($n > 510){ 11 | print STDERR "boot block too large: $n bytes (max 510)\n"; 12 | exit 1; 13 | } 14 | 15 | print STDERR "boot block is $n bytes (max 510)\n"; 16 | 17 | $buf .= "\0" x (510-$n); 18 | $buf .= "\x55\xAA"; 19 | 20 | open(BB, ">$ARGV[0]") || die "open >$ARGV[0]: $!"; 21 | binmode BB; 22 | print BB $buf; 23 | close BB; 24 | -------------------------------------------------------------------------------- /conf/env.mk: -------------------------------------------------------------------------------- 1 | # env.mk - configuration variables for the JOS lab 2 | 3 | # '$(V)' controls whether the lab makefiles print verbose commands (the 4 | # actual shell commands run by Make), as well as the "overview" commands 5 | # (such as '+ cc lib/readline.c'). 6 | # 7 | # For overview commands only, the line should read 'V = @'. 8 | # For overview and verbose commands, the line should read 'V ='. 9 | V = @ 10 | 11 | # If your system-standard GNU toolchain is ELF-compatible, then comment 12 | # out the following line to use those tools (as opposed to the i386-jos-elf 13 | # tools that the 6.828 make system looks for by default). 14 | # 15 | # GCCPREFIX='' 16 | 17 | # If the makefile cannot find your QEMU binary, uncomment the 18 | # following line and set it to the full path to QEMU. 19 | # 20 | # QEMU= 21 | -------------------------------------------------------------------------------- /conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=4 2 | PACKAGEDATE=Wed Nov 2 21:31:50 EDT 2011 3 | -------------------------------------------------------------------------------- /gdbstart.txt: -------------------------------------------------------------------------------- 1 | break env_create 2 | c 3 | next 4 | next 5 | next 6 | next 7 | next 8 | next 9 | next 10 | next 11 | next 12 | -------------------------------------------------------------------------------- /gitcmd.txt: -------------------------------------------------------------------------------- 1 | git status 2 | git fetch 3 | git clone https://HawxChen@github.com/HawxChen/MIT-6.828-Adventure.git . 4 | git checkout -b lab3 origin/lab3 5 | git remote add mit http://pdos.csail.mit.edu/6.828/2011/jos.git 6 | git branch -a 7 | git pull mit lab3 8 | git mergetool -t vim [file] 9 | http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed 10 | http://www.mariopareja.com/blog/archive/2010/01/11/how-to-push-a-new-local-branch-to-a-remote.aspx 11 | push newly created local branch to remote 12 | #git push origin branch_name 13 | vimdiff 14 | git mergetool -t vimdiff [filename] 15 | git difftool --tool=vimdiff --no-prompt 16 | -------------------------------------------------------------------------------- /grade-lab1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | qemuopts="-hda obj/kern/kernel.img" 4 | . ./grade-functions.sh 5 | 6 | 7 | $make 8 | 9 | check () { 10 | pts=20 11 | echo_n "Printf: " 12 | if grep "6828 decimal is 15254 octal!" jos.out >/dev/null 13 | then 14 | pass 15 | else 16 | fail 17 | fi 18 | 19 | pts=10 20 | echo "Backtrace:" 21 | args=`grep "ebp f01.* eip f0100.* args" jos.out | awk '{ print $6 }'` 22 | cnt=`echo $args | grep '^00000000 00000000 00000001 00000002 00000003 00000004 00000005' | wc -w` 23 | echo_n " Count " 24 | if [ $cnt -eq 8 ] 25 | then 26 | pass 27 | else 28 | fail 29 | fi 30 | 31 | cnt=`grep "ebp f01.* eip f0100.* args" jos.out | awk 'BEGIN { FS = ORS = " " } 32 | { print $6 } 33 | END { printf("\n") }' | grep '^00000000 00000000 00000001 00000002 00000003 00000004 00000005' | wc -w` 34 | echo_n " Args " 35 | if [ $cnt -eq 8 ]; then 36 | pass 37 | else 38 | fail "($args)" 39 | fi 40 | 41 | syms=`grep "kern/init.c:[0-9]*: *test_backtrace[+]" jos.out` 42 | symcnt=`grep "kern/init.c:[0-9]*: *test_backtrace[+]" jos.out | wc -l` 43 | echo_n " Symbols " 44 | if [ $symcnt -eq 6 ]; then 45 | pass 46 | else 47 | fail "($syms)" 48 | fi 49 | } 50 | 51 | run 52 | check 53 | 54 | showfinal 55 | -------------------------------------------------------------------------------- /grade-lab2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | qemuopts="-hda obj/kern/kernel.img" 4 | . ./grade-functions.sh 5 | 6 | 7 | $make 8 | 9 | check () { 10 | pts=20 11 | echo_n "Physical page allocator: " 12 | if grep "check_page_alloc() succeeded!" jos.out >/dev/null 13 | then 14 | pass 15 | else 16 | fail 17 | fi 18 | 19 | pts=20 20 | echo_n "Page management: " 21 | if grep "check_page() succeeded!" jos.out >/dev/null 22 | then 23 | pass 24 | else 25 | fail 26 | fi 27 | 28 | pts=20 29 | echo_n "Kernel page directory: " 30 | if grep "check_kern_pgdir() succeeded!" jos.out >/dev/null 31 | then 32 | pass 33 | else 34 | fail 35 | fi 36 | 37 | pts=10 38 | echo_n "Page management 2: " 39 | if grep "check_page_installed_pgdir() succeeded!" jos.out >/dev/null 40 | then 41 | pass 42 | else 43 | fail 44 | fi 45 | } 46 | 47 | run 48 | check 49 | 50 | showfinal 51 | -------------------------------------------------------------------------------- /grade-lab3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | qemuopts="-hda obj/kern/kernel.img" 4 | . ./grade-functions.sh 5 | 6 | 7 | $make 8 | 9 | # the [00001000] tags should have [] in them, but that's 10 | # a regular expression reserved character, and i'll be damned if 11 | # I can figure out how many \ i need to add to get through 12 | # however many times the shell interprets this string. sigh. 13 | 14 | pts=10 15 | 16 | runtest1 divzero \ 17 | ! '1/0 is ........!' \ 18 | 'Incoming TRAP frame at 0xefbfff..' \ 19 | 'TRAP frame at 0xf.......' \ 20 | ' trap 0x00000000 Divide error' \ 21 | ' eip 0x008.....' \ 22 | ' ss 0x----0023' \ 23 | '.00001000. free env 00001000' 24 | 25 | runtest1 softint \ 26 | 'Welcome to the JOS kernel monitor!' \ 27 | 'Incoming TRAP frame at 0xefbfffbc' \ 28 | 'TRAP frame at 0xf.......' \ 29 | ' trap 0x0000000d General Protection' \ 30 | ' eip 0x008.....' \ 31 | ' ss 0x----0023' \ 32 | '.00001000. free env 00001000' 33 | 34 | runtest1 badsegment \ 35 | 'Incoming TRAP frame at 0xefbfffbc' \ 36 | 'TRAP frame at 0xf.......' \ 37 | ' trap 0x0000000d General Protection' \ 38 | ' err 0x00000028' \ 39 | ' eip 0x008.....' \ 40 | ' ss 0x----0023' \ 41 | '.00001000. free env 00001000' 42 | 43 | showpart A 44 | 45 | pts=5 46 | 47 | runtest1 faultread \ 48 | ! 'I read ........ from location 0!' \ 49 | '.00001000. user fault va 00000000 ip 008.....' \ 50 | 'Incoming TRAP frame at 0xefbfffbc' \ 51 | 'TRAP frame at 0xf.......' \ 52 | ' trap 0x0000000e Page Fault' \ 53 | ' err 0x00000004.*' \ 54 | '.00001000. free env 00001000' 55 | 56 | runtest1 faultreadkernel \ 57 | ! 'I read ........ from location 0xf0100000!' \ 58 | '.00001000. user fault va f0100000 ip 008.....' \ 59 | 'Incoming TRAP frame at 0xefbfffbc' \ 60 | 'TRAP frame at 0xf.......' \ 61 | ' trap 0x0000000e Page Fault' \ 62 | ' err 0x00000005.*' \ 63 | '.00001000. free env 00001000' \ 64 | 65 | runtest1 faultwrite \ 66 | '.00001000. user fault va 00000000 ip 008.....' \ 67 | 'Incoming TRAP frame at 0xefbfffbc' \ 68 | 'TRAP frame at 0xf.......' \ 69 | ' trap 0x0000000e Page Fault' \ 70 | ' err 0x00000006.*' \ 71 | '.00001000. free env 00001000' 72 | 73 | runtest1 faultwritekernel \ 74 | '.00001000. user fault va f0100000 ip 008.....' \ 75 | 'Incoming TRAP frame at 0xefbfffbc' \ 76 | 'TRAP frame at 0xf.......' \ 77 | ' trap 0x0000000e Page Fault' \ 78 | ' err 0x00000007.*' \ 79 | '.00001000. free env 00001000' 80 | 81 | 82 | runtest1 breakpoint \ 83 | 'Welcome to the JOS kernel monitor!' \ 84 | 'Incoming TRAP frame at 0xefbfffbc' \ 85 | 'TRAP frame at 0xf.......' \ 86 | ' trap 0x00000003 Breakpoint' \ 87 | ' eip 0x008.....' \ 88 | ' ss 0x----0023' \ 89 | ! '.00001000. free env 00001000' 90 | 91 | runtest1 testbss \ 92 | 'Making sure bss works right...' \ 93 | 'Yes, good. Now doing a wild write off the end...' \ 94 | '.00001000. user fault va 00c..... ip 008.....' \ 95 | '.00001000. free env 00001000' 96 | 97 | runtest1 hello \ 98 | '.00000000. new env 00001000' \ 99 | 'hello, world' \ 100 | 'i am environment 00001000' \ 101 | '.00001000. exiting gracefully' \ 102 | '.00001000. free env 00001000' \ 103 | 'Destroyed the only environment - nothing more to do!' 104 | 105 | runtest1 buggyhello \ 106 | '.00001000. user_mem_check assertion failure for va 00000001' \ 107 | '.00001000. free env 00001000' 108 | 109 | runtest1 buggyhello2 \ 110 | '.00001000. user_mem_check assertion failure for va 0....000' \ 111 | '.00001000. free env 00001000' \ 112 | ! 'hello, world' 113 | 114 | runtest1 evilhello \ 115 | '.00001000. user_mem_check assertion failure for va f0100...' \ 116 | '.00001000. free env 00001000' 117 | 118 | showpart B 119 | 120 | showfinal 121 | -------------------------------------------------------------------------------- /inc/assert.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_INC_ASSERT_H 4 | #define JOS_INC_ASSERT_H 5 | 6 | #include 7 | 8 | void _warn (const char *, int, const char *, ...); 9 | void _panic (const char *, int, const char *, ...) __attribute__ ((noreturn)); 10 | 11 | #define warn(...) _warn(__FILE__, __LINE__, __VA_ARGS__) 12 | #define panic(...) _panic(__FILE__, __LINE__, __VA_ARGS__) 13 | 14 | #define assert(x) \ 15 | do { if (!(x)) panic("assertion failed: %s", #x); } while (0) 16 | 17 | // static_assert(x) will generate a compile-time error if 'x' is false. 18 | #define static_assert(x) switch (x) case 0: case (x): 19 | 20 | #endif /* !JOS_INC_ASSERT_H */ 21 | -------------------------------------------------------------------------------- /inc/elf.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_INC_ELF_H 2 | #define JOS_INC_ELF_H 3 | 4 | #define ELF_MAGIC 0x464C457FU /* "\x7FELF" in little endian */ 5 | 6 | struct Elf 7 | { 8 | uint32_t e_magic; // must equal ELF_MAGIC 9 | uint8_t e_elf[12]; 10 | uint16_t e_type; 11 | uint16_t e_machine; 12 | uint32_t e_version; 13 | uint32_t e_entry; 14 | uint32_t e_phoff; 15 | uint32_t e_shoff; 16 | uint32_t e_flags; 17 | uint16_t e_ehsize; 18 | uint16_t e_phentsize; 19 | uint16_t e_phnum; 20 | uint16_t e_shentsize; 21 | uint16_t e_shnum; 22 | uint16_t e_shstrndx; 23 | }; 24 | 25 | struct Proghdr 26 | { 27 | uint32_t p_type; 28 | uint32_t p_offset; 29 | uint32_t p_va; 30 | uint32_t p_pa; 31 | uint32_t p_filesz; 32 | uint32_t p_memsz; 33 | uint32_t p_flags; 34 | uint32_t p_align; 35 | }; 36 | 37 | struct Secthdr 38 | { 39 | uint32_t sh_name; 40 | uint32_t sh_type; 41 | uint32_t sh_flags; 42 | uint32_t sh_addr; 43 | uint32_t sh_offset; 44 | uint32_t sh_size; 45 | uint32_t sh_link; 46 | uint32_t sh_info; 47 | uint32_t sh_addralign; 48 | uint32_t sh_entsize; 49 | }; 50 | 51 | // Values for Proghdr::p_type 52 | #define ELF_PROG_LOAD 1 53 | 54 | // Flag bits for Proghdr::p_flags 55 | #define ELF_PROG_FLAG_EXEC 1 56 | #define ELF_PROG_FLAG_WRITE 2 57 | #define ELF_PROG_FLAG_READ 4 58 | 59 | // Values for Secthdr::sh_type 60 | #define ELF_SHT_NULL 0 61 | #define ELF_SHT_PROGBITS 1 62 | #define ELF_SHT_SYMTAB 2 63 | #define ELF_SHT_STRTAB 3 64 | 65 | // Values for Secthdr::sh_name 66 | #define ELF_SHN_UNDEF 0 67 | 68 | #endif /* !JOS_INC_ELF_H */ 69 | -------------------------------------------------------------------------------- /inc/env.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_INC_ENV_H 4 | #define JOS_INC_ENV_H 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | typedef int32_t envid_t; 11 | 12 | // An environment ID 'envid_t' has three parts: 13 | // 14 | // +1+---------------21-----------------+--------10--------+ 15 | // |0| Uniqueifier | Environment | 16 | // | | | Index | 17 | // +------------------------------------+------------------+ 18 | // \--- ENVX(eid) --/ 19 | // 20 | // The environment index ENVX(eid) equals the environment's offset in the 21 | // 'envs[]' array. The uniqueifier distinguishes environments that were 22 | // created at different times, but share the same environment index. 23 | // 24 | // All real environments are greater than 0 (so the sign bit is zero). 25 | // envid_ts less than 0 signify errors. The envid_t == 0 is special, and 26 | // stands for the current environment. 27 | 28 | #define LOG2NENV 10 29 | #define NENV (1 << LOG2NENV) 30 | #define ENVX(envid) ((envid) & (NENV - 1)) 31 | //#define GETENV(_envid) ((_envid) ? (&(envs[ENVX(_envid)])): (curenv)) 32 | 33 | // Values of env_status in struct Env 34 | enum { 35 | ENV_FREE = 0, 36 | ENV_DYING, 37 | ENV_RUNNABLE, 38 | ENV_RUNNING, 39 | ENV_NOT_RUNNABLE 40 | }; 41 | 42 | // Special environment types 43 | enum EnvType 44 | { 45 | ENV_TYPE_USER = 0, 46 | ENV_TYPE_IDLE, 47 | }; 48 | 49 | struct Env { 50 | struct Trapframe env_tf; // Saved registers 51 | struct Env *env_link; // Next free Env 52 | envid_t env_id; // Unique environment identifier 53 | envid_t env_parent_id; // env_id of this env's parent 54 | enum EnvType env_type; // Indicates special system environments 55 | unsigned env_status; // Status of the environment 56 | uint32_t env_runs; // Number of times environment has run 57 | int env_cpunum; // The CPU that the env is running on 58 | 59 | // Address space 60 | pde_t *env_pgdir; // Kernel virtual address of page dir 61 | 62 | // Exception handling 63 | void *env_pgfault_upcall; // Page fault upcall entry point 64 | 65 | // Lab 4 IPC 66 | bool env_ipc_recving; // Env is blocked receiving 67 | void *env_ipc_dstva; // VA at which to map received page 68 | uint32_t env_ipc_value; // Data value sent to us 69 | envid_t env_ipc_from; // envid of the sender 70 | int env_ipc_perm; // Perm of page mapping received 71 | }; 72 | 73 | #endif // !JOS_INC_ENV_H 74 | -------------------------------------------------------------------------------- /inc/error.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_INC_ERROR_H 4 | #define JOS_INC_ERROR_H 5 | 6 | enum 7 | { 8 | // Kernel error codes -- keep in sync with list in lib/printfmt.c. 9 | E_UNSPECIFIED = 1, // Unspecified or unknown problem 10 | E_BAD_ENV = 2, // Environment doesn't exist or otherwise 11 | // cannot be used in requested action 12 | E_INVAL = 3, // Invalid parameter 13 | E_NO_MEM = 4, // Request failed due to memory shortage 14 | E_NO_FREE_ENV = 5, // Attempt to create a new environment beyond 15 | // the maximum allowed 16 | E_FAULT = 6, // Memory fault 17 | 18 | E_IPC_NOT_RECV = 7, // Attempt to send to env that is not recving 19 | E_EOF = 8, // Unexpected end of file 20 | 21 | MAXERROR 22 | }; 23 | 24 | #endif // !JOS_INC_ERROR_H */ 25 | -------------------------------------------------------------------------------- /inc/lib.h: -------------------------------------------------------------------------------- 1 | // Main public header file for our user-land support library, 2 | // whose code lives in the lib directory. 3 | // This library is roughly our OS's version of a standard C library, 4 | // and is intended to be linked into all user-mode applications 5 | // (NOT the kernel or boot loader). 6 | 7 | #ifndef JOS_INC_LIB_H 8 | #define JOS_INC_LIB_H 1 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define USED(x) (void)(x) 22 | 23 | // main user program 24 | void umain (int argc, char **argv); 25 | 26 | // libmain.c or entry.S 27 | extern const char *binaryname; 28 | extern const volatile struct Env *thisenv; 29 | extern const volatile struct Env envs[NENV]; 30 | extern const volatile struct Page pages[]; 31 | 32 | // exit.c 33 | void exit (void); 34 | 35 | // pgfault.c 36 | void set_pgfault_handler(void (*handler)(struct UTrapframe *utf)); 37 | 38 | // readline.c 39 | char *readline (const char *buf); 40 | 41 | // syscall.c 42 | void sys_cputs(const char *string, size_t len); 43 | int sys_cgetc(void); 44 | envid_t sys_getenvid(void); 45 | int sys_env_destroy(envid_t); 46 | void sys_yield(void); 47 | static envid_t sys_exofork(void); 48 | int sys_env_set_status(envid_t env, int status); 49 | int sys_env_set_pgfault_upcall(envid_t env, void *upcall); 50 | int sys_page_alloc(envid_t env, void *pg, int perm); 51 | int sys_page_map(envid_t src_env, void *src_pg, 52 | envid_t dst_env, void *dst_pg, int perm); 53 | int sys_page_unmap(envid_t env, void *pg); 54 | int sys_ipc_try_send(envid_t to_env, uint32_t value, void *pg, int perm); 55 | int sys_ipc_recv(void *rcv_pg); 56 | 57 | // This must be inlined. Exercise for reader: why? 58 | static __inline envid_t __attribute__((always_inline)) 59 | sys_exofork(void) 60 | { 61 | envid_t ret; 62 | __asm __volatile("int %2" 63 | : "=a" (ret) 64 | : "a" (SYS_exofork), 65 | "i" (T_SYSCALL) 66 | ); 67 | return ret; 68 | } 69 | 70 | // ipc.c 71 | void ipc_send(envid_t to_env, uint32_t value, void *pg, int perm); 72 | int32_t ipc_recv(envid_t *from_env_store, void *pg, int *perm_store); 73 | envid_t ipc_find_env(enum EnvType type); 74 | 75 | // fork.c 76 | #define PTE_SHARE 0x400 77 | envid_t fork(void); 78 | envid_t sfork(void); // Challenge! 79 | 80 | 81 | 82 | /* File open modes */ 83 | #define O_RDONLY 0x0000 /* open for reading only */ 84 | #define O_WRONLY 0x0001 /* open for writing only */ 85 | #define O_RDWR 0x0002 /* open for reading and writing */ 86 | #define O_ACCMODE 0x0003 /* mask for above modes */ 87 | 88 | #define O_CREAT 0x0100 /* create if nonexistent */ 89 | #define O_TRUNC 0x0200 /* truncate to zero length */ 90 | #define O_EXCL 0x0400 /* error if already exists */ 91 | #define O_MKDIR 0x0800 /* create directory, not regular file */ 92 | 93 | #endif // !JOS_INC_LIB_H 94 | -------------------------------------------------------------------------------- /inc/stab.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_STAB_H 2 | #define JOS_STAB_H 3 | #include 4 | 5 | // 6 | // STABS debugging info 7 | 8 | // The JOS kernel debugger can understand some debugging information 9 | // in the STABS format. For more information on this format, see 10 | // http://sourceware.org/gdb/onlinedocs/stabs.html 11 | 12 | // The constants below define some symbol types used by various debuggers 13 | // and compilers. JOS uses the N_SO, N_SOL, N_FUN, and N_SLINE types. 14 | 15 | #define N_GSYM 0x20 // global symbol 16 | #define N_FNAME 0x22 // F77 function name 17 | #define N_FUN 0x24 // procedure name 18 | #define N_STSYM 0x26 // data segment variable 19 | #define N_LCSYM 0x28 // bss segment variable 20 | #define N_MAIN 0x2a // main function name 21 | #define N_PC 0x30 // global Pascal symbol 22 | #define N_RSYM 0x40 // register variable 23 | #define N_SLINE 0x44 // text segment line number 24 | #define N_DSLINE 0x46 // data segment line number 25 | #define N_BSLINE 0x48 // bss segment line number 26 | #define N_SSYM 0x60 // structure/union element 27 | #define N_SO 0x64 // main source file name 28 | #define N_LSYM 0x80 // stack variable 29 | #define N_BINCL 0x82 // include file beginning 30 | #define N_SOL 0x84 // included source file name 31 | #define N_PSYM 0xa0 // parameter variable 32 | #define N_EINCL 0xa2 // include file end 33 | #define N_ENTRY 0xa4 // alternate entry point 34 | #define N_LBRAC 0xc0 // left bracket 35 | #define N_EXCL 0xc2 // deleted include file 36 | #define N_RBRAC 0xe0 // right bracket 37 | #define N_BCOMM 0xe2 // begin common 38 | #define N_ECOMM 0xe4 // end common 39 | #define N_ECOML 0xe8 // end common (local name) 40 | #define N_LENG 0xfe // length of preceding entry 41 | 42 | // Entries in the STABS table are formatted as follows. 43 | struct Stab 44 | { 45 | uint32_t n_strx; // index into string table of name 46 | uint8_t n_type; // type of symbol 47 | uint8_t n_other; // misc info (usually empty) 48 | uint16_t n_desc; // description field 49 | uintptr_t n_value; // value of symbol 50 | }; 51 | 52 | #endif /* !JOS_STAB_H */ 53 | -------------------------------------------------------------------------------- /inc/stdarg.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: stdarg.h,v 1.12 1995/12/25 23:15:31 mycroft Exp $ */ 2 | 3 | #ifndef JOS_INC_STDARG_H 4 | #define JOS_INC_STDARG_H 5 | 6 | typedef __builtin_va_list va_list; 7 | 8 | #define va_start(ap, last) __builtin_va_start(ap, last) 9 | 10 | #define va_arg(ap, type) __builtin_va_arg(ap, type) 11 | 12 | #define va_end(ap) __builtin_va_end(ap) 13 | 14 | #endif /* !JOS_INC_STDARG_H */ 15 | -------------------------------------------------------------------------------- /inc/stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_INC_STDIO_H 2 | #define JOS_INC_STDIO_H 3 | 4 | #include 5 | 6 | #ifndef NULL 7 | #define NULL ((void *) 0) 8 | #endif /* !NULL */ 9 | 10 | // lib/stdio.c 11 | void cputchar (int c); 12 | int getchar (void); 13 | int iscons (int fd); 14 | 15 | // lib/printfmt.c 16 | void printfmt (void (*putch) (int, void *), void *putdat, const char *fmt, 17 | ...); 18 | void vprintfmt (void (*putch) (int, void *), void *putdat, const char *fmt, 19 | va_list); 20 | int snprintf (char *str, int size, const char *fmt, ...); 21 | int vsnprintf (char *str, int size, const char *fmt, va_list); 22 | 23 | // lib/printf.c 24 | int cprintf (const char *fmt, ...); 25 | int vcprintf (const char *fmt, va_list); 26 | 27 | // lib/fprintf.c 28 | int printf (const char *fmt, ...); 29 | int fprintf (int fd, const char *fmt, ...); 30 | int vfprintf (int fd, const char *fmt, va_list); 31 | 32 | // lib/readline.c 33 | char *readline (const char *prompt); 34 | 35 | #endif /* !JOS_INC_STDIO_H */ 36 | -------------------------------------------------------------------------------- /inc/string.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_INC_STRING_H 2 | #define JOS_INC_STRING_H 3 | 4 | #include 5 | 6 | int strlen (const char *s); 7 | int strnlen (const char *s, size_t size); 8 | char *strcpy (char *dst, const char *src); 9 | char *strncpy (char *dst, const char *src, size_t size); 10 | char *strcat (char *dst, const char *src); 11 | size_t strlcpy (char *dst, const char *src, size_t size); 12 | int strcmp (const char *s1, const char *s2); 13 | int strncmp (const char *s1, const char *s2, size_t size); 14 | char *strchr (const char *s, char c); 15 | char *strfind (const char *s, char c); 16 | 17 | void *memset (void *dst, int c, size_t len); 18 | /* no memcpy - use memmove instead */ 19 | void *memmove (void *dst, const void *src, size_t len); 20 | 21 | int memcmp (const void *s1, const void *s2, size_t len); 22 | void *memfind (const void *s, int c, size_t len); 23 | 24 | long strtol (const char *s, char **endptr, int base); 25 | 26 | #endif /* not JOS_INC_STRING_H */ 27 | -------------------------------------------------------------------------------- /inc/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_INC_SYSCALL_H 2 | #define JOS_INC_SYSCALL_H 3 | 4 | /* system call numbers */ 5 | enum { 6 | SYS_cputs = 0, 7 | SYS_cgetc, 8 | SYS_getenvid, 9 | SYS_env_destroy, 10 | SYS_page_alloc, 11 | SYS_page_map, 12 | SYS_page_unmap, 13 | SYS_exofork, 14 | SYS_env_set_status, 15 | SYS_env_set_pgfault_upcall, 16 | SYS_yield, 17 | SYS_ipc_try_send, 18 | SYS_ipc_recv, 19 | NSYSCALLS 20 | }; 21 | 22 | #endif /* !JOS_INC_SYSCALL_H */ 23 | -------------------------------------------------------------------------------- /inc/types.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_INC_TYPES_H 2 | #define JOS_INC_TYPES_H 3 | 4 | #ifndef NULL 5 | #define NULL ((void*) 0) 6 | #endif 7 | 8 | #define FALSE (0) 9 | #define TRUE (1) 10 | #define NIL NULL 11 | // Represents true-or-false values 12 | typedef int bool; 13 | 14 | // Explicitly-sized versions of integer types 15 | typedef __signed char int8_t; 16 | typedef unsigned char uint8_t; 17 | typedef short int16_t; 18 | typedef unsigned short uint16_t; 19 | typedef int int32_t; 20 | typedef unsigned int uint32_t; 21 | typedef long long int64_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | // Pointers and addresses are 32 bits long. 25 | // We use pointer types to represent virtual addresses, 26 | // uintptr_t to represent the numerical values of virtual addresses, 27 | // and physaddr_t to represent physical addresses. 28 | typedef int32_t intptr_t; 29 | typedef uint32_t uintptr_t; 30 | typedef uint32_t physaddr_t; 31 | typedef uint32_t virtaddr_t; 32 | 33 | // Page numbers are 32 bits long. 34 | typedef uint32_t ppn_t; 35 | 36 | // size_t is used for memory object sizes. 37 | typedef uint32_t size_t; 38 | // ssize_t is a signed version of ssize_t, used in case there might be an 39 | // error return. 40 | typedef int32_t ssize_t; 41 | 42 | // off_t is used for file offsets and lengths. 43 | typedef int32_t off_t; 44 | 45 | // Efficient min and max operations 46 | #define MIN(_a, _b) \ 47 | ({ \ 48 | typeof(_a) __a = (_a); \ 49 | typeof(_b) __b = (_b); \ 50 | __a <= __b ? __a : __b; \ 51 | }) 52 | #define MAX(_a, _b) \ 53 | ({ \ 54 | typeof(_a) __a = (_a); \ 55 | typeof(_b) __b = (_b); \ 56 | __a >= __b ? __a : __b; \ 57 | }) 58 | 59 | /* 60 | * Hawx: Return the address for head of the page 61 | */ 62 | // Rounding operations (efficient when n is a power of 2) 63 | // Round down to the nearest multiple of n 64 | #define ROUNDDOWN(a, n) \ 65 | ({ \ 66 | uint32_t __a = (uint32_t) (a); \ 67 | (typeof(a)) (__a - __a % (n)); \ 68 | }) 69 | /* 70 | * Hawx: Return the address for tail of the page 71 | */ 72 | // Round up to the nearest multiple of n 73 | #define ROUNDUP(a, n) \ 74 | ({ \ 75 | uint32_t __n = (uint32_t) (n); \ 76 | (typeof(a)) (ROUNDDOWN((uint32_t) (a) + __n - 1, __n)); \ 77 | }) 78 | 79 | // Return the offset of 'member' relative to the beginning of a struct type 80 | #define offsetof(type, member) ((size_t) (&((type*)0)->member)) 81 | 82 | #endif /* !JOS_INC_TYPES_H */ 83 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | ./upcode_util/cscope.sh 3 | ./upcode_util/indent.sh 4 | find . -name '\.*\.sw*' | xargs rm 5 | -------------------------------------------------------------------------------- /kern/Makefrag: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile fragment for JOS kernel. 3 | # This is NOT a complete makefile; 4 | # you must run GNU make in the top-level directory 5 | # where the GNUmakefile is located. 6 | # 7 | 8 | OBJDIRS += kern 9 | 10 | KERN_LDFLAGS := $(LDFLAGS) -T kern/kernel.ld -nostdlib 11 | 12 | # entry.S must be first, so that it's the first code in the text segment!!! 13 | # 14 | # We also snatch the use of a couple handy source files 15 | # from the lib directory, to avoid gratuitous code duplication. 16 | KERN_SRCFILES := kern/entry.S \ 17 | kern/entrypgdir.c \ 18 | kern/init.c \ 19 | kern/console.c \ 20 | kern/monitor.c \ 21 | kern/pmap.c \ 22 | kern/env.c \ 23 | kern/kclock.c \ 24 | kern/picirq.c \ 25 | kern/printf.c \ 26 | kern/trap.c \ 27 | kern/trapentry.S \ 28 | kern/sched.c \ 29 | kern/syscall.c \ 30 | kern/kdebug.c \ 31 | lib/printfmt.c \ 32 | lib/readline.c \ 33 | lib/string.c 34 | 35 | # Source files for LAB4 36 | KERN_SRCFILES += kern/mpentry.S \ 37 | kern/mpconfig.c \ 38 | kern/lapic.c \ 39 | kern/spinlock.c 40 | 41 | # Only build files if they exist. 42 | KERN_SRCFILES := $(wildcard $(KERN_SRCFILES)) 43 | 44 | # Binary program images to embed within the kernel. 45 | # Binary files for LAB3 46 | KERN_BINFILES := user/hello \ 47 | user/buggyhello \ 48 | user/buggyhello2 \ 49 | user/evilhello \ 50 | user/testbss \ 51 | user/divzero \ 52 | user/breakpoint \ 53 | user/softint \ 54 | user/badsegment \ 55 | user/faultread \ 56 | user/faultreadkernel \ 57 | user/faultwrite \ 58 | user/faultwritekernel 59 | 60 | # Binary files for LAB4 61 | KERN_BINFILES += user/idle \ 62 | user/yield \ 63 | user/dumbfork \ 64 | user/stresssched \ 65 | user/faultdie \ 66 | user/faultregs \ 67 | user/faultalloc \ 68 | user/faultallocbad \ 69 | user/faultnostack \ 70 | user/faultbadhandler \ 71 | user/faultevilhandler \ 72 | user/forktree \ 73 | user/spin \ 74 | user/fairness \ 75 | user/pingpong \ 76 | user/pingpongs \ 77 | user/primes 78 | KERN_OBJFILES := $(patsubst %.c, $(OBJDIR)/%.o, $(KERN_SRCFILES)) 79 | KERN_OBJFILES := $(patsubst %.S, $(OBJDIR)/%.o, $(KERN_OBJFILES)) 80 | KERN_OBJFILES := $(patsubst $(OBJDIR)/lib/%, $(OBJDIR)/kern/%, $(KERN_OBJFILES)) 81 | 82 | KERN_BINFILES := $(patsubst %, $(OBJDIR)/%, $(KERN_BINFILES)) 83 | 84 | # How to build kernel object files 85 | $(OBJDIR)/kern/%.o: kern/%.c 86 | @echo + cc $< 87 | @mkdir -p $(@D) 88 | $(V)$(CC) -nostdinc $(KERN_CFLAGS) -c -o $@ $< 89 | 90 | $(OBJDIR)/kern/%.o: kern/%.S 91 | @echo + as $< 92 | @mkdir -p $(@D) 93 | $(V)$(CC) -nostdinc $(KERN_CFLAGS) -c -o $@ $< 94 | 95 | $(OBJDIR)/kern/%.o: lib/%.c 96 | @echo + cc $< 97 | @mkdir -p $(@D) 98 | $(V)$(CC) -nostdinc $(KERN_CFLAGS) -c -o $@ $< 99 | 100 | # How to build the kernel itself 101 | $(OBJDIR)/kern/kernel: $(KERN_OBJFILES) $(KERN_BINFILES) kern/kernel.ld 102 | @echo + ld $@ 103 | $(V)$(LD) -o $@ $(KERN_LDFLAGS) $(KERN_OBJFILES) $(GCC_LIB) -b binary $(KERN_BINFILES) 104 | $(V)$(OBJDUMP) -S $@ > $@.asm 105 | $(V)$(NM) -n $@ > $@.sym 106 | ./upcode_util/cscope.sh 107 | 108 | # How to build the kernel disk image 109 | $(OBJDIR)/kern/kernel.img: $(OBJDIR)/kern/kernel $(OBJDIR)/boot/boot 110 | @echo + mk $@ 111 | $(V)dd if=/dev/zero of=$(OBJDIR)/kern/kernel.img~ count=10000 2>/dev/null 112 | $(V)dd if=$(OBJDIR)/boot/boot of=$(OBJDIR)/kern/kernel.img~ conv=notrunc 2>/dev/null 113 | $(V)dd if=$(OBJDIR)/kern/kernel of=$(OBJDIR)/kern/kernel.img~ seek=1 conv=notrunc 2>/dev/null 114 | $(V)mv $(OBJDIR)/kern/kernel.img~ $(OBJDIR)/kern/kernel.img 115 | 116 | all: $(OBJDIR)/kern/kernel.img 117 | 118 | grub: $(OBJDIR)/jos-grub 119 | 120 | $(OBJDIR)/jos-grub: $(OBJDIR)/kern/kernel 121 | @echo + oc $@ 122 | $(V)$(OBJCOPY) --adjust-vma=0x10000000 $^ $@ 123 | -------------------------------------------------------------------------------- /kern/console.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef _CONSOLE_H_ 4 | #define _CONSOLE_H_ 5 | #ifndef JOS_KERNEL 6 | #error "This is a JOS kernel header; user programs should not #include it" 7 | #endif 8 | 9 | #include 10 | 11 | #define MONO_BASE 0x3B4 12 | #define MONO_BUF 0xB0000 13 | #define CGA_BASE 0x3D4 14 | #define CGA_BUF 0xB8000 15 | 16 | #define CRT_ROWS 25 17 | #define CRT_COLS 80 18 | #define CRT_SIZE (CRT_ROWS * CRT_COLS) 19 | 20 | void cons_init (void); 21 | int cons_getc (void); 22 | 23 | void kbd_intr (void); // irq 1 24 | void serial_intr (void); // irq 4 25 | 26 | #endif /* _CONSOLE_H_ */ 27 | -------------------------------------------------------------------------------- /kern/cpu.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef JOS_INC_CPU_H 3 | #define JOS_INC_CPU_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | // Maximum number of CPUs 11 | #define NCPU 8 12 | 13 | // Values of status in struct Cpu 14 | enum { 15 | CPU_UNUSED = 0, 16 | CPU_STARTED, 17 | }; 18 | 19 | // Per-CPU state 20 | struct Cpu { 21 | uint8_t cpu_id; // Local APIC ID; index into cpus[] below 22 | volatile unsigned cpu_status; // The status of the CPU 23 | struct Env *cpu_env; // The currently-running environment. 24 | struct Taskstate cpu_ts; // Used by x86 to find stack for interrupt 25 | }; 26 | 27 | // Initialized in mpconfig.c 28 | extern struct Cpu cpus[NCPU]; 29 | extern int ncpu; // Total number of CPUs in the system 30 | extern struct Cpu *bootcpu; // The boot-strap processor (BSP) 31 | extern volatile uint32_t *lapic; // MMIO address to access the local-APIC 32 | 33 | // Per-CPU kernel stacks 34 | extern unsigned char percpu_kstacks[NCPU][KSTKSIZE]; 35 | 36 | int cpunum(void); 37 | #define thiscpu (&cpus[cpunum()]) 38 | 39 | void mp_init(void); 40 | void lapic_init(void); 41 | void lapic_startap(uint8_t apicid, uint32_t addr); 42 | void lapic_eoi(void); 43 | void lapic_ipi(int vector); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /kern/entry.S: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | # Shift Right Logical 8 | #define SRL(val, shamt) (((val) >> (shamt)) & ~(-1 << (32 - (shamt)))) 9 | 10 | 11 | ################################################################### 12 | # The kernel (this code) is linked at address ~(KERNBASE + 1 Meg), 13 | # but the bootloader loads it at address ~1 Meg. 14 | # 15 | # RELOC(x) maps a symbol x from its link address to its actual 16 | # location in physical memory (its load address). 17 | ################################################################### 18 | 19 | #define RELOC(x) ((x) - KERNBASE) 20 | 21 | #define MULTIBOOT_HEADER_MAGIC (0x1BADB002) 22 | #define MULTIBOOT_HEADER_FLAGS (0) 23 | #define CHECKSUM (-(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)) 24 | 25 | ################################################################### 26 | # entry point 27 | ################################################################### 28 | 29 | .text 30 | 31 | # The Multiboot header 32 | .align 4 33 | .long MULTIBOOT_HEADER_MAGIC 34 | .long MULTIBOOT_HEADER_FLAGS 35 | .long CHECKSUM 36 | 37 | # '_start' specifies the ELF entry point. Since we haven't set up 38 | # virtual memory when the bootloader enters this code, we need the 39 | # bootloader to jump to the *physical* address of the entry point. 40 | .globl _start 41 | _start = RELOC(entry) 42 | 43 | .globl entry 44 | entry: 45 | movw $0x1234,0x472 # warm boot 46 | 47 | # We haven't set up virtual memory yet, so we're running from 48 | # the physical address the boot loader loaded the kernel at: 1MB 49 | # (plus a few bytes). However, the C code is linked to run at 50 | # KERNBASE+1MB. Hence, we set up a trivial page directory that 51 | # translates virtual addresses [KERNBASE, KERNBASE+4MB) to 52 | # physical addresses [0, 4MB). This 4MB region will be suffice 53 | # until we set up our real page table in mem_init in lab 2. 54 | 55 | # Load the physical address of entry_pgdir into cr3. entry_pgdir 56 | # is defined in entrypgdir.c. 57 | movl $(RELOC(entry_pgdir)), %eax 58 | movl %eax, %cr3 59 | # Turn on paging. 60 | movl %cr0, %eax 61 | orl $(CR0_PE|CR0_PG|CR0_WP), %eax 62 | movl %eax, %cr0 63 | 64 | # Now paging is enabled, but we're still running at a low EIP 65 | # (why is this okay?). Jump up above KERNBASE before entering 66 | # C code. 67 | mov $relocated, %eax 68 | jmp *%eax 69 | relocated: 70 | 71 | # Clear the frame pointer register (EBP) 72 | # so that once we get into debugging C code, 73 | # stack backtraces will be terminated properly. 74 | movl $0x0,%ebp # nuke frame pointer 75 | 76 | # Set the stack pointer 77 | movl $(bootstacktop),%esp 78 | 79 | # now to C code 80 | call i386_init 81 | 82 | # Should never get here, but in case we do, just spin. 83 | spin: jmp spin 84 | 85 | 86 | .data 87 | ################################################################### 88 | # boot stack 89 | ################################################################### 90 | .p2align PGSHIFT # force page alignment 91 | .globl bootstack 92 | bootstack: 93 | .space KSTKSIZE 94 | .globl bootstacktop 95 | bootstacktop: 96 | 97 | -------------------------------------------------------------------------------- /kern/env.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_KERN_ENV_H 4 | #define JOS_KERN_ENV_H 5 | 6 | #include 7 | #include 8 | 9 | //extern struct Env *curenv; // Current environment 10 | extern struct Env *envs; // All environments 11 | #define curenv (thiscpu->cpu_env) // Current environment 12 | extern struct Segdesc gdt[]; 13 | 14 | void env_init (void); 15 | void env_init_percpu (void); 16 | int env_alloc (struct Env **e, envid_t parent_id); 17 | void env_free (struct Env *e); 18 | void env_create (uint8_t * binary, size_t size, enum EnvType type); 19 | void env_destroy (struct Env *e); // Does not return if e == curenv 20 | 21 | int envid2env (envid_t envid, struct Env **env_store, bool checkperm); 22 | // The following two functions do not return 23 | void env_run (struct Env *e) __attribute__ ((noreturn)); 24 | void env_pop_tf (struct Trapframe *tf) __attribute__ ((noreturn)); 25 | 26 | // Without this extra macro, we couldn't pass macros like TEST to 27 | // ENV_CREATE because of the C pre-processor's argument prescan rule. 28 | #define ENV_PASTE3(x, y, z) x ## y ## z 29 | 30 | #define ENV_CREATE(x, type) \ 31 | do { \ 32 | extern uint8_t ENV_PASTE3(_binary_obj_, x, _start)[], \ 33 | ENV_PASTE3(_binary_obj_, x, _size)[]; \ 34 | env_create(ENV_PASTE3(_binary_obj_, x, _start), \ 35 | (int)ENV_PASTE3(_binary_obj_, x, _size), \ 36 | type); \ 37 | } while (0) 38 | 39 | #endif // !JOS_KERN_ENV_H 40 | -------------------------------------------------------------------------------- /kern/genvect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #0~47 3 | def printFromat(trapHandle,i): 4 | print trapHandle + str(i) + " , " + str(i) + ")" 5 | for i in range(256): 6 | #Vect: 8/10/11/12/13/14 push error number. 7 | if i in [8,10,11,12,13,14]: 8 | printFromat("TRAPHANDLER(vect",i) 9 | else: 10 | printFromat("TRAPHANDLER_NOEC(vect",i) 11 | 12 | for i in range(256): 13 | print " .long " + "vect" + str(i); 14 | -------------------------------------------------------------------------------- /kern/kclock.c: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | /* Support for reading the NVRAM from the real-time clock. */ 4 | 5 | #include 6 | 7 | #include 8 | 9 | 10 | unsigned 11 | mc146818_read (unsigned reg) 12 | { 13 | outb (IO_RTC, reg); 14 | return inb (IO_RTC + 1); 15 | } 16 | 17 | void 18 | mc146818_write (unsigned reg, unsigned datum) 19 | { 20 | outb (IO_RTC, reg); 21 | outb (IO_RTC + 1, datum); 22 | } 23 | -------------------------------------------------------------------------------- /kern/kclock.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_KERN_KCLOCK_H 4 | #define JOS_KERN_KCLOCK_H 5 | #ifndef JOS_KERNEL 6 | #error "This is a JOS kernel header; user programs should not #include it" 7 | #endif 8 | 9 | #define IO_RTC 0x070 /* RTC port */ 10 | 11 | #define MC_NVRAM_START 0xe /* start of NVRAM: offset 14 */ 12 | #define MC_NVRAM_SIZE 50 /* 50 bytes of NVRAM */ 13 | 14 | /* NVRAM bytes 7 & 8: base memory size */ 15 | #define NVRAM_BASELO (MC_NVRAM_START + 7) /* low byte; RTC off. 0x15 */ 16 | #define NVRAM_BASEHI (MC_NVRAM_START + 8) /* high byte; RTC off. 0x16 */ 17 | 18 | /* NVRAM bytes 9 & 10: extended memory size */ 19 | #define NVRAM_EXTLO (MC_NVRAM_START + 9) /* low byte; RTC off. 0x17 */ 20 | #define NVRAM_EXTHI (MC_NVRAM_START + 10) /* high byte; RTC off. 0x18 */ 21 | 22 | /* NVRAM bytes 34 and 35: extended memory POSTed size */ 23 | #define NVRAM_PEXTLO (MC_NVRAM_START + 34) /* low byte; RTC off. 0x30 */ 24 | #define NVRAM_PEXTHI (MC_NVRAM_START + 35) /* high byte; RTC off. 0x31 */ 25 | 26 | /* NVRAM byte 36: current century. (please increment in Dec99!) */ 27 | #define NVRAM_CENTURY (MC_NVRAM_START + 36) /* RTC offset 0x32 */ 28 | 29 | //void kclock_init (void); 30 | unsigned mc146818_read (unsigned reg); 31 | void mc146818_write (unsigned reg, unsigned datum); 32 | 33 | #endif // !JOS_KERN_KCLOCK_H 34 | -------------------------------------------------------------------------------- /kern/kdebug.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_KERN_KDEBUG_H 2 | #define JOS_KERN_KDEBUG_H 3 | 4 | #include 5 | 6 | // Debug information about a particular instruction pointer 7 | struct Eipdebuginfo 8 | { 9 | const char *eip_file; // Source code filename for EIP 10 | int eip_line; // Source code linenumber for EIP 11 | 12 | const char *eip_fn_name; // Name of function containing EIP 13 | // - Note: not null terminated! 14 | int eip_fn_namelen; // Length of function name 15 | uintptr_t eip_fn_addr; // Address of start of function 16 | int eip_fn_narg; // Number of function arguments 17 | }; 18 | 19 | int debuginfo_eip (uintptr_t eip, struct Eipdebuginfo *info); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /kern/kernel.ld: -------------------------------------------------------------------------------- 1 | /* Simple linker script for the JOS kernel. 2 | See the GNU ld 'info' manual ("info ld") to learn the syntax. */ 3 | 4 | OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") 5 | OUTPUT_ARCH(i386) 6 | ENTRY(_start) 7 | 8 | SECTIONS 9 | { 10 | /* Link the kernel at this address: "." means the current address */ 11 | . = 0xF0100000; 12 | 13 | /* AT(...) gives the load address of this section, which tells 14 | the boot loader where to load the kernel in physical memory */ 15 | .text : AT(0x100000) { 16 | *(.text .stub .text.* .gnu.linkonce.t.*) 17 | } 18 | 19 | PROVIDE(etext = .); /* Define the 'etext' symbol to this value */ 20 | 21 | .rodata : { 22 | *(.rodata .rodata.* .gnu.linkonce.r.*) 23 | } 24 | 25 | /* Include debugging information in kernel memory */ 26 | .stab : { 27 | PROVIDE(__STAB_BEGIN__ = .); 28 | *(.stab); 29 | PROVIDE(__STAB_END__ = .); 30 | BYTE(0) /* Force the linker to allocate space 31 | for this section */ 32 | } 33 | 34 | .stabstr : { 35 | PROVIDE(__STABSTR_BEGIN__ = .); 36 | *(.stabstr); 37 | PROVIDE(__STABSTR_END__ = .); 38 | BYTE(0) /* Force the linker to allocate space 39 | for this section */ 40 | } 41 | 42 | /* Adjust the address for the data segment to the next page */ 43 | . = ALIGN(0x1000); 44 | 45 | /* The data segment */ 46 | .data : { 47 | *(.data) 48 | } 49 | 50 | PROVIDE(edata = .); 51 | 52 | .bss : { 53 | *(.bss) 54 | } 55 | 56 | PROVIDE(end = .); 57 | 58 | /DISCARD/ : { 59 | *(.eh_frame .note.GNU-stack) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /kern/monitor.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_KERN_MONITOR_H 2 | #define JOS_KERN_MONITOR_H 3 | #ifndef JOS_KERNEL 4 | #error "This is a JOS kernel header; user programs should not #include it" 5 | #endif 6 | 7 | struct Trapframe; 8 | 9 | // Activate the kernel monitor, 10 | // optionally providing a trap frame indicating the current state 11 | // (NULL if none). 12 | void monitor (struct Trapframe *tf); 13 | 14 | // Functions implementing monitor commands. 15 | int mon_help (int argc, char **argv, struct Trapframe *tf); 16 | int mon_kerninfo (int argc, char **argv, struct Trapframe *tf); 17 | int mon_backtrace (int argc, char **argv, struct Trapframe *tf); 18 | 19 | #endif // !JOS_KERN_MONITOR_H 20 | -------------------------------------------------------------------------------- /kern/mpentry.S: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #include 4 | #include 5 | 6 | ################################################################### 7 | # entry point for APs 8 | ################################################################### 9 | 10 | # Each non-boot CPU ("AP") is started up in response to a STARTUP 11 | # IPI from the boot CPU. Section B.4.2 of the Multi-Processor 12 | # Specification says that the AP will start in real mode with CS:IP 13 | # set to XY00:0000, where XY is an 8-bit value sent with the 14 | # STARTUP. Thus this code must start at a 4096-byte boundary. 15 | # 4*1024 bytes 16 | # 17 | # Because this code sets DS to zero, it must run from an address in 18 | # the low 2^16 bytes of physical memory. 19 | # 64*1024 bytes 20 | # 21 | # boot_aps() (in init.c) copies this code to MPENTRY_PADDR (which 22 | # satisfies the above restrictions). Then, for each AP, it stores the 23 | # address of the pre-allocated per-core stack in mpentry_kstack, sends 24 | # the STARTUP IPI, and waits for this code to acknowledge that it has 25 | # started (which happens in mp_main in init.c). 26 | # 27 | # This code is similar to boot/boot.S except that 28 | # - it does not need to enable A20 29 | # - it uses MPBOOTPHYS to calculate absolute addresses of its 30 | # symbols, rather than relying on the linker to fill them 31 | 32 | #define RELOC(x) ((x) - KERNBASE) 33 | #define MPBOOTPHYS(s) ((s) - mpentry_start + MPENTRY_PADDR) 34 | 35 | .set PROT_MODE_CSEG, 0x8 # kernel code segment selector 36 | .set PROT_MODE_DSEG, 0x10 # kernel data segment selector 37 | 38 | .code16 39 | .globl mpentry_start 40 | mpentry_start: 41 | cli 42 | 43 | xorw %ax, %ax 44 | movw %ax, %ds 45 | movw %ax, %es 46 | movw %ax, %ss 47 | 48 | lgdt MPBOOTPHYS(gdtdesc) 49 | movl %cr0, %eax 50 | orl $CR0_PE, %eax 51 | movl %eax, %cr0 52 | 53 | ljmpl $(PROT_MODE_CSEG), $(MPBOOTPHYS(start32)) 54 | 55 | .code32 56 | start32: 57 | movw $(PROT_MODE_DSEG), %ax 58 | movw %ax, %ds 59 | movw %ax, %es 60 | movw %ax, %ss 61 | movw $0, %ax 62 | movw %ax, %fs 63 | movw %ax, %gs 64 | 65 | # Set up initial page table. We cannot use kern_pgdir yet because 66 | # we are still running at a low EIP. 67 | movl $(RELOC(entry_pgdir)), %eax 68 | movl %eax, %cr3 69 | # Turn on paging. 70 | movl %cr0, %eax 71 | orl $(CR0_PE|CR0_PG|CR0_WP), %eax 72 | movl %eax, %cr0 73 | 74 | # Switch to the per-cpu stack allocated in mem_init() 75 | movl mpentry_kstack, %esp 76 | movl $0x0, %ebp # nuke frame pointer 77 | 78 | # Call mp_main(). (Exercise for the reader: why the indirect call?) 79 | movl $mp_main, %eax 80 | call *%eax 81 | # call %eax 82 | # call (%eax) 83 | # call *(%eax) 84 | # jmp *%eax 85 | # jmp ... 86 | 87 | # If mp_main returns (it shouldn't), loop. 88 | spin: 89 | jmp spin 90 | 91 | # Bootstrap GDT 92 | .p2align 2 # force 4 byte alignment 93 | gdt: 94 | SEG_NULL # null seg 95 | SEG(STA_X|STA_R, 0x0, 0xffffffff) # code seg 96 | SEG(STA_W, 0x0, 0xffffffff) # data seg 97 | 98 | gdtdesc: 99 | .word 0x17 # sizeof(gdt) - 1 100 | .long MPBOOTPHYS(gdt) # address gdt 101 | 102 | .globl mpentry_end 103 | mpentry_end: 104 | nop 105 | -------------------------------------------------------------------------------- /kern/picirq.c: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | 9 | // Current IRQ mask. 10 | // Initial IRQ mask has interrupt 2 enabled (for slave 8259A). 11 | uint16_t irq_mask_8259A = 0xFFFF & ~(1<> 8)); 80 | cprintf("enabled interrupts:"); 81 | for (i = 0; i < 16; i++) 82 | if (~mask & (1< 21 | #include 22 | 23 | extern uint16_t irq_mask_8259A; 24 | void pic_init(void); 25 | void irq_setmask_8259A(uint16_t mask); 26 | #endif // !__ASSEMBLER__ 27 | 28 | #endif // !JOS_KERN_PICIRQ_H 29 | -------------------------------------------------------------------------------- /kern/pmap.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_KERN_PMAP_H 4 | #define JOS_KERN_PMAP_H 5 | #ifndef JOS_KERNEL 6 | #error "This is a JOS kernel header; user programs should not #include it" 7 | #endif 8 | 9 | #include 10 | #include 11 | struct Env; 12 | 13 | #define CREATE TRUE 14 | #define NO_CREATE FALSE 15 | extern char bootstacktop[], bootstack[]; 16 | 17 | extern struct Page *pages; 18 | extern size_t npages; 19 | 20 | extern pde_t *kern_pgdir; 21 | 22 | /*Hawx: 23 | For Page Directory's self page. 24 | */ 25 | #define GET_PGD_PG(__pgdir) (pa2page(PADDR(__pgdir))) 26 | #define INC_PGP(__pgdir) (GET_PGD_PG(__pgdir))->pp_ref++ 27 | #define DEC_PGP(__pgdir) (GET_PGD_PG(__pgdir))->pp_ref-- 28 | /* 29 | For Page Directory Entry's page. 30 | */ 31 | 32 | /* This macro takes a kernel virtual address -- an address that points above 33 | * KERNBASE, where the machine's maximum 256MB of physical memory is mapped -- 34 | * and returns the corresponding physical address. It panics if you pass it a 35 | * non-kernel virtual address. 36 | */ 37 | /* 38 | * Hawx: Turn Virtual to Physical. 39 | */ 40 | #define PADDR(kva) _paddr(__FILE__, __LINE__, kva) 41 | 42 | static inline physaddr_t 43 | _paddr (const char *file, int line, void *kva) 44 | { 45 | if ((uint32_t) kva < KERNBASE) 46 | _panic (file, line, "PADDR called with invalid kva %08lx", kva); 47 | return (physaddr_t) kva - KERNBASE; 48 | } 49 | 50 | /* This macro takes a physical address and returns the corresponding kernel 51 | * virtual address. It panics if you pass an invalid physical address. */ 52 | 53 | /* 54 | * Hawx: Turn Physical to Virtual. 55 | */ 56 | #define KADDR(pa) _kaddr(__FILE__, __LINE__, pa) 57 | 58 | static inline void * 59 | _kaddr (const char *file, int line, physaddr_t pa) 60 | { 61 | if (PGNUM (pa) >= npages) 62 | _panic (file, line, "KADDR called with invalid pa %08lx", pa); 63 | return (void *) (pa + KERNBASE); 64 | } 65 | 66 | 67 | enum 68 | { 69 | // For page_alloc, zero the returned physical page. 70 | ALLOC_ZERO = 1 << 0, 71 | }; 72 | 73 | void mem_init (void); 74 | 75 | void page_init (void); 76 | struct Page *page_alloc (int alloc_flags); 77 | void page_free (struct Page *pp); 78 | int page_insert (pde_t * pgdir, struct Page *pp, void *va, int perm); 79 | void page_remove (pde_t * pgdir, void *va); 80 | struct Page *page_lookup (pde_t * pgdir, void *va, pte_t ** pte_store); 81 | void page_decref (struct Page *pp); 82 | 83 | void tlb_invalidate (pde_t * pgdir, void *va); 84 | 85 | int user_mem_check (struct Env *env, const void *va, size_t len, int perm); 86 | void user_mem_assert (struct Env *env, const void *va, size_t len, int perm); 87 | 88 | static inline physaddr_t 89 | page2pa (struct Page *pp) 90 | { 91 | return (pp - pages) << PGSHIFT; 92 | } 93 | 94 | static inline struct Page * 95 | pa2page (physaddr_t pa) 96 | { 97 | if (PGNUM (pa) >= npages) 98 | panic ("pa2page called with invalid pa"); 99 | return &pages[PGNUM (pa)]; 100 | } 101 | 102 | static inline void * 103 | page2kva (struct Page *pp) 104 | { 105 | return KADDR (page2pa (pp)); 106 | } 107 | 108 | static inline void * 109 | kva2page (void *kva) 110 | { 111 | return &pages[PGNUM ((PADDR (kva)))]; 112 | } 113 | 114 | pte_t *pgdir_walk (pde_t * pgdir, const void *va, int create); 115 | pte_t *get_kernpgdir (); 116 | 117 | #endif /* !JOS_KERN_PMAP_H */ 118 | -------------------------------------------------------------------------------- /kern/printf.c: -------------------------------------------------------------------------------- 1 | // Simple implementation of cprintf console output for the kernel, 2 | // based on printfmt() and the kernel console's cputchar(). 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | static void 10 | putch (int ch, int *cnt) 11 | { 12 | cputchar (ch); 13 | *cnt++; 14 | } 15 | 16 | int 17 | vcprintf (const char *fmt, va_list ap) 18 | { 19 | int cnt = 0; 20 | 21 | vprintfmt ((void *) putch, &cnt, fmt, ap); 22 | return cnt; 23 | } 24 | 25 | int 26 | cprintf (const char *fmt, ...) 27 | { 28 | va_list ap; 29 | int cnt; 30 | 31 | va_start (ap, fmt); 32 | cnt = vcprintf (fmt, ap); 33 | va_end (ap); 34 | 35 | return cnt; 36 | } 37 | -------------------------------------------------------------------------------- /kern/sched.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | // Choose a user environment to run and run it. 9 | void 10 | sched_yield(void) 11 | { 12 | struct Env *idle; 13 | int i = -1,cnt; 14 | 15 | // Implement simple round-robin scheduling. 16 | // 17 | // Search through 'envs' for an ENV_RUNNABLE environment in 18 | // circular fashion starting just after the env this CPU was 19 | // last running. Switch to the first such environment found. 20 | // 21 | // If no envs are runnable, but the environment previously 22 | // running on this CPU is still ENV_RUNNING, it's okay to 23 | // choose that environment. 24 | // 25 | // Never choose an environment that's currently running on 26 | // another CPU (env_status == ENV_RUNNING) and never choose an 27 | // idle environment (env_type == ENV_TYPE_IDLE). If there are 28 | // no runnable environments, simply drop through to the code 29 | // below to switch to this CPU's idle environment. 30 | 31 | // LAB 4: Your code here. 32 | 33 | if(0 == thiscpu->cpu_env) 34 | { 35 | i = 0; 36 | } 37 | else if(thiscpu->cpu_env->env_status == ENV_RUNNING) 38 | { /*Note: It might check for future needed state*/ 39 | thiscpu->cpu_env->env_status = ENV_RUNNABLE; 40 | i = (curenv - envs) + 1;//bug_019 41 | } 42 | 43 | if(i == -1) 44 | { 45 | i = thiscpu->cpu_env - envs; 46 | } 47 | 48 | for ( cnt = 0 ;cnt < NENV ;i++, cnt++) 49 | { 50 | if(i >= NENV) 51 | i = i % NENV; 52 | if(envs[i].env_type != ENV_TYPE_IDLE && envs[i].env_status == ENV_RUNNABLE) 53 | { 54 | /*env_run will do 55 | * 1: set thiscpu's cpu_env to the passed env. 56 | * 2: set env's state to ENV_RUNNING 57 | * */ 58 | env_run(&envs[i]); 59 | break; 60 | } 61 | } 62 | 63 | // For debugging and testing purposes, if there are no 64 | // runnable environments other than the idle environments, 65 | // drop into the kernel monitor. 66 | #ifdef TESTING_GRADE_PURPOSE 67 | for (i = 0; i < NENV; i++) { 68 | if (envs[i].env_type != ENV_TYPE_IDLE && 69 | (envs[i].env_status == ENV_RUNNABLE || 70 | envs[i].env_status == ENV_RUNNING)) 71 | { 72 | // cprintf("===env %d is the GUY===\n",i); //Debug 73 | break; 74 | } 75 | } 76 | if (i == NENV) { 77 | cprintf("No more runnable environments!\n"); 78 | while (1) monitor(NULL); 79 | } 80 | #endif 81 | 82 | // Run this CPU's idle environment when nothing else is runnable.' 83 | if(cnt == NENV) 84 | { 85 | idle = &envs[cpunum()]; 86 | if (!(idle->env_status == ENV_RUNNABLE || idle->env_status == ENV_RUNNING)) 87 | panic("CPU %d: No idle environment!", cpunum()); 88 | env_run(idle); 89 | //Compare it to co-routine scheduler in xv6 90 | //It is never returned here. 91 | cprintf("CPU %d is back\n",cpunum()); 92 | } 93 | 94 | 95 | } 96 | -------------------------------------------------------------------------------- /kern/sched.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_KERN_SCHED_H 4 | #define JOS_KERN_SCHED_H 5 | #ifndef JOS_KERNEL 6 | # error "This is a JOS kernel header; user programs should not #include it" 7 | #endif 8 | 9 | // This function does not return. 10 | void sched_yield(void) __attribute__((noreturn)); 11 | 12 | #endif // !JOS_KERN_SCHED_H 13 | -------------------------------------------------------------------------------- /kern/spinlock.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_INC_SPINLOCK_H 2 | #define JOS_INC_SPINLOCK_H 3 | 4 | #include 5 | 6 | // Comment this to disable spinlock debugging 7 | #define DEBUG_SPINLOCK 8 | 9 | // Mutual exclusion lock. 10 | char lock_record[2048]; 11 | struct spinlock { 12 | unsigned locked; // Is the lock held? 13 | 14 | #ifdef DEBUG_SPINLOCK 15 | // For debugging: 16 | char *name; // Name of lock. 17 | struct Cpu *cpu; // The CPU holding the lock. 18 | uintptr_t pcs[10]; // The call stack (an array of program counters) 19 | // that locked the lock. 20 | #endif 21 | }; 22 | 23 | void __spin_initlock(struct spinlock *lk, char *name); 24 | void spin_lock(struct spinlock *lk); 25 | void spin_unlock(struct spinlock *lk); 26 | 27 | #define spin_initlock(lock) __spin_initlock(lock, #lock) 28 | 29 | extern struct spinlock kernel_lock; 30 | 31 | static inline void 32 | lock_kernel(void) 33 | { 34 | #ifdef bug_017 35 | extern uint32_t lock_cnt; 36 | spin_lock(&kernel_lock); 37 | lock_cnt++; 38 | #else 39 | spin_lock(&kernel_lock); 40 | #endif 41 | } 42 | 43 | static inline void 44 | unlock_kernel(void) 45 | { 46 | #ifdef bug_017 47 | const unsigned int lock_div_base = 100000; 48 | extern uint32_t lock_cnt; 49 | static int i = 0; 50 | spin_unlock(&kernel_lock); 51 | lock_cnt++; 52 | if(i < lock_cnt/lock_div_base) 53 | { 54 | i = lock_cnt/lock_div_base; 55 | cprintf("unlock i:%d\n", lock_cnt); 56 | if(lock_cnt == 0xFFFFFFFF) 57 | { 58 | i = 0; 59 | lock_cnt = 0; 60 | } 61 | } 62 | 63 | #else 64 | spin_unlock(&kernel_lock); 65 | #endif 66 | // Normally we wouldn't need to do this, but QEMU only runs 67 | // one CPU at a time and has a long time-slice. Without the 68 | // pause, this CPU is likely to reacquire the lock before 69 | // another CPU has even been given a chance to acquire it. 70 | asm volatile("pause"); 71 | } 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /kern/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef JOS_KERN_SYSCALL_H 2 | #define JOS_KERN_SYSCALL_H 3 | #ifndef JOS_KERNEL 4 | #error "This is a JOS kernel header; user programs should not #include it" 5 | #endif 6 | 7 | #include 8 | 9 | int32_t syscall (uint32_t num, uint32_t a1, uint32_t a2, uint32_t a3, 10 | uint32_t a4, uint32_t a5); 11 | 12 | #endif /* !JOS_KERN_SYSCALL_H */ 13 | -------------------------------------------------------------------------------- /kern/trap.h: -------------------------------------------------------------------------------- 1 | /* See COPYRIGHT for copyright information. */ 2 | 3 | #ifndef JOS_KERN_TRAP_H 4 | #define JOS_KERN_TRAP_H 5 | #ifndef JOS_KERNEL 6 | #error "This is a JOS kernel header; user programs should not #include it" 7 | #endif 8 | 9 | #include 10 | #include 11 | 12 | /* The kernel's interrupt descriptor table */ 13 | #define IDT_ENTRIES 256 14 | extern struct Gatedesc idt[]; 15 | extern struct Pseudodesc idt_pd; 16 | 17 | void trap_init (void); 18 | void trap_init_percpu (void); 19 | void print_regs (struct PushRegs *regs); 20 | void print_trapframe (struct Trapframe *tf); 21 | void page_fault_handler (struct Trapframe *); 22 | void breakpoint_handler (struct Trapframe *); 23 | void backtrace (struct Trapframe *); 24 | 25 | #endif /* JOS_KERN_TRAP_H */ 26 | -------------------------------------------------------------------------------- /lib/Makefrag: -------------------------------------------------------------------------------- 1 | OBJDIRS += lib 2 | 3 | LIB_SRCFILES := lib/console.c \ 4 | lib/libmain.c \ 5 | lib/exit.c \ 6 | lib/panic.c \ 7 | lib/printf.c \ 8 | lib/printfmt.c \ 9 | lib/readline.c \ 10 | lib/string.c \ 11 | lib/syscall.c 12 | 13 | LIB_SRCFILES := $(LIB_SRCFILES) \ 14 | lib/pgfault.c \ 15 | lib/pfentry.S \ 16 | lib/fork.c \ 17 | lib/ipc.c 18 | 19 | 20 | 21 | LIB_OBJFILES := $(patsubst lib/%.c, $(OBJDIR)/lib/%.o, $(LIB_SRCFILES)) 22 | LIB_OBJFILES := $(patsubst lib/%.S, $(OBJDIR)/lib/%.o, $(LIB_OBJFILES)) 23 | 24 | $(OBJDIR)/lib/%.o: lib/%.c 25 | @echo + cc[USER] $< 26 | @mkdir -p $(@D) 27 | $(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $< 28 | 29 | $(OBJDIR)/lib/%.o: lib/%.S 30 | @echo + as[USER] $< 31 | @mkdir -p $(@D) 32 | $(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $< 33 | 34 | $(OBJDIR)/lib/libjos.a: $(LIB_OBJFILES) 35 | @echo + ar $@ 36 | $(V)$(AR) r $@ $(LIB_OBJFILES) 37 | -------------------------------------------------------------------------------- /lib/console.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | void 6 | cputchar (int ch) 7 | { 8 | char c = ch; 9 | 10 | // Unlike standard Unix's putchar, 11 | // the cputchar function _always_ outputs to the system console. 12 | sys_cputs (&c, 1); 13 | } 14 | 15 | int 16 | getchar (void) 17 | { 18 | int r; 19 | // sys_cgetc does not block, but getchar should. 20 | while ((r = sys_cgetc()) == 0) 21 | sys_yield(); 22 | return r; 23 | } 24 | -------------------------------------------------------------------------------- /lib/entry.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | .data 5 | // Define the global symbols 'envs', 'pages', 'vpt', and 'vpd' 6 | // so that they can be used in C as if they were ordinary global arrays. 7 | .globl envs 8 | .set envs, UENVS 9 | .globl pages 10 | .set pages, UPAGES 11 | .globl vpt 12 | .set vpt, UVPT 13 | .globl vpd 14 | .set vpd, (UVPT+(UVPT>>12)*4) 15 | 16 | 17 | // Entrypoint - this is where the kernel (or our parent environment) 18 | // starts us running when we are initially loaded into a new environment. 19 | .text 20 | .globl _start 21 | _start: 22 | // See if we were started with arguments on the stack 23 | cmpl $USTACKTOP, %esp 24 | jne args_exist 25 | 26 | // If not, push dummy argc/argv arguments. 27 | // This happens when we are loaded by the kernel, 28 | // because the kernel does not know about passing arguments. 29 | pushl $0 30 | pushl $0 31 | 32 | args_exist: 33 | call libmain 34 | 1: jmp 1b 35 | 36 | -------------------------------------------------------------------------------- /lib/exit.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | void 5 | exit (void) 6 | { 7 | sys_env_destroy (0); 8 | } 9 | -------------------------------------------------------------------------------- /lib/ipc.c: -------------------------------------------------------------------------------- 1 | // User-level IPC library routines 2 | 3 | #include 4 | 5 | // Receive a value via IPC and return it. 6 | // If 'pg' is nonnull, then any page sent by the sender will be mapped at 7 | // that address. 8 | // If 'from_env_store' is nonnull, then store the IPC sender's envid in 9 | // *from_env_store. 10 | // If 'perm_store' is nonnull, then store the IPC sender's page permission 11 | // in *perm_store (this is nonzero iff a page was successfully 12 | // transferred to 'pg'). 13 | // If the system call fails, then store 0 in *fromenv and *perm (if 14 | // they're nonnull) and return the error. 15 | // Otherwise, return the value sent by the sender 16 | // 17 | // Hint: 18 | // Use 'thisenv' to discover the value and who sent it. 19 | // If 'pg' is null, pass sys_ipc_recv a value that it will understand 20 | // as meaning "no page". (Zero is not the right value, since that's 21 | // a perfectly valid place to map a page.) 22 | int32_t 23 | ipc_recv(envid_t *from_env_store, void *pg, int *perm_store) 24 | { 25 | // LAB 4: Your code here. 26 | 27 | //How to distinguish 0 and NULL. 28 | 29 | int32_t ret = 0; 30 | ret = sys_ipc_recv(pg == NULL ? IPC_NO_PAGE : pg); 31 | 32 | if(from_env_store != NULL){ 33 | *from_env_store = (ret == 0 ? thisenv->env_ipc_from : 0); 34 | } 35 | 36 | if(perm_store != NULL){ 37 | *perm_store = (ret == 0 ? thisenv->env_ipc_perm : 0); 38 | } 39 | 40 | return ret == 0 ? thisenv->env_ipc_value: ret; 41 | } 42 | 43 | // Send 'val' (and 'pg' with 'perm', if 'pg' is nonnull) to 'toenv'. 44 | // This function keeps trying until it succeeds. 45 | // It should panic() on any error other than -E_IPC_NOT_RECV. 46 | // 47 | // Hint: 48 | // Use sys_yield() to be CPU-friendly. 49 | // If 'pg' is null, pass sys_ipc_recv a value that it will understand 50 | // as meaning "no page". (Zero is not the right value.) 51 | void 52 | ipc_send(envid_t to_env, uint32_t val, void *pg, int perm) 53 | { 54 | // LAB 4: Your code here. 55 | int32_t ret = 0; 56 | #ifdef DEBUG_SYSCALL_C 57 | cprintf("===[0x%x]Execute in ipc_try_send: %d===\n",thisenv->env_id,val); 58 | #endif 59 | do{ 60 | sys_yield(); 61 | ret = sys_ipc_try_send( 62 | to_env, 63 | val, 64 | pg == NULL ? IPC_NO_PAGE : pg , 65 | pg == NULL ? 0 :perm); 66 | }while(-E_IPC_NOT_RECV == ret); 67 | 68 | if(ret != 0 ) 69 | panic("envid:0x%d's ipc sending to 0x%x failed ret:0x%x\n", 70 | thisenv->env_id, to_env, ret); 71 | } 72 | 73 | // Find the first environment of the given type. We'll use this to 74 | // find special environments. 75 | // Returns 0 if no such environment exists. 76 | envid_t 77 | ipc_find_env(enum EnvType type) 78 | { 79 | int i; 80 | for (i = 0; i < NENV; i++) 81 | if (envs[i].env_type == type) 82 | return envs[i].env_id; 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /lib/libmain.c: -------------------------------------------------------------------------------- 1 | // Called from entry.S to get us going. 2 | // entry.S already took care of defining envs, pages, vpd, and vpt. 3 | 4 | #include 5 | 6 | extern void umain (int argc, char **argv); 7 | 8 | const volatile struct Env *thisenv; 9 | const char *binaryname = ""; 10 | 11 | void 12 | libmain (int argc, char **argv) 13 | { 14 | // set thisenv to point at our Env structure in envs[]. 15 | // LAB 3: Your code here. 16 | thisenv = (struct Env *) &envs[ENVX (sys_getenvid ())]; 17 | //cprintf ("thisenv:0x%x,envs:0x%x,idx:%d\n", thisenv, envs, ENVX (sys_getenvid ())); //Debug 18 | // save the name of the program so that panic() can use it 19 | if (argc > 0) 20 | binaryname = argv[0]; 21 | 22 | // call user main routine 23 | umain (argc, argv); 24 | 25 | // exit gracefully 26 | exit (); 27 | } 28 | -------------------------------------------------------------------------------- /lib/panic.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | const char *argv0; 5 | 6 | /* 7 | * Panic is called on unresolvable fatal errors. 8 | * It prints "panic: ", then causes a breakpoint exception, 9 | * which causes JOS to enter the JOS kernel monitor. 10 | */ 11 | void 12 | _panic (const char *file, int line, const char *fmt, ...) 13 | { 14 | va_list ap; 15 | 16 | va_start (ap, fmt); 17 | 18 | // Print the panic message 19 | if (argv0) 20 | cprintf ("%s: ", argv0); 21 | cprintf ("[%08x] user panic in %s at %s:%d: ", 22 | sys_getenvid (), binaryname, file, line); 23 | vcprintf (fmt, ap); 24 | cprintf ("\n"); 25 | 26 | // Cause a breakpoint exception 27 | while (1) 28 | asm volatile ("int3"); 29 | } 30 | -------------------------------------------------------------------------------- /lib/pgfault.c: -------------------------------------------------------------------------------- 1 | // User-level page fault handler support. 2 | // Rather than register the C page fault handler directly with the 3 | // kernel as the page fault handler, we register the assembly language 4 | // wrapper in pfentry.S, which in turns calls the registered C 5 | // function. 6 | 7 | #include 8 | 9 | 10 | // Assembly language pgfault entrypoint defined in lib/pfentry.S. 11 | extern void _pgfault_upcall(void); 12 | 13 | // Pointer to currently installed C-language pgfault handler. 14 | void (*_pgfault_handler)(struct UTrapframe *utf); 15 | 16 | // 17 | // Set the page fault handler function. 18 | // If there isn't one yet, _pgfault_handler will be 0. 19 | // The first time we register a handler, we need to 20 | // allocate an exception stack (one page of memory with its top 21 | // at UXSTACKTOP), and tell the kernel to call the assembly-language 22 | // _pgfault_upcall routine when a page fault occurs. 23 | // 24 | void 25 | set_pgfault_handler(void (*handler)(struct UTrapframe *utf)) 26 | { 27 | int r; 28 | 29 | if (_pgfault_handler == 0) { 30 | // First time through! 31 | // LAB 4: Your code here. 32 | if(0 != (r = sys_page_alloc(0, (void*) UXSTACKBASE,PTE_U | PTE_W | PTE_P))) 33 | panic("allocating at %x in set_pgfault_handler: %e", UXSTACKBASE, r); 34 | sys_env_set_pgfault_upcall(0,_pgfault_upcall); 35 | } 36 | 37 | // Save handler pointer for assembly to call. 38 | _pgfault_handler = handler; 39 | } 40 | -------------------------------------------------------------------------------- /lib/printf.c: -------------------------------------------------------------------------------- 1 | // Implementation of cprintf console output for user environments, 2 | // based on printfmt() and the sys_cputs() system call. 3 | // 4 | // cprintf is a debugging statement, not a generic output statement. 5 | // It is very important that it always go to the console, especially when 6 | // debugging file descriptor code! 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | // Collect up to 256 characters into a buffer 15 | // and perform ONE system call to print all of them, 16 | // in order to make the lines output to the console atomic 17 | // and prevent interrupts from causing context switches 18 | // in the middle of a console output line and such. 19 | struct printbuf 20 | { 21 | int idx; // current buffer index 22 | int cnt; // total bytes printed so far 23 | char buf[256]; 24 | }; 25 | 26 | 27 | static void 28 | putch (int ch, struct printbuf *b) 29 | { 30 | b->buf[b->idx++] = ch; 31 | if (b->idx == 256 - 1) 32 | { 33 | sys_cputs (b->buf, b->idx); 34 | b->idx = 0; 35 | } 36 | b->cnt++; 37 | } 38 | 39 | int 40 | vcprintf (const char *fmt, va_list ap) 41 | { 42 | struct printbuf b; 43 | 44 | b.idx = 0; 45 | b.cnt = 0; 46 | vprintfmt ((void *) putch, &b, fmt, ap); 47 | sys_cputs (b.buf, b.idx); 48 | 49 | return b.cnt; 50 | } 51 | 52 | int 53 | cprintf (const char *fmt, ...) 54 | { 55 | va_list ap; 56 | int cnt; 57 | 58 | va_start (ap, fmt); 59 | cnt = vcprintf (fmt, ap); 60 | va_end (ap); 61 | 62 | return cnt; 63 | } 64 | -------------------------------------------------------------------------------- /lib/readline.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define BUFLEN 1024 5 | static char buf[BUFLEN]; 6 | 7 | char * 8 | readline (const char *prompt) 9 | { 10 | int i, c, echoing; 11 | 12 | if (prompt != NULL) 13 | cprintf ("%s", prompt); 14 | 15 | i = 0; 16 | echoing = iscons (0); 17 | while (1) 18 | { 19 | c = getchar (); 20 | if (c < 0) 21 | { 22 | cprintf ("read error: %e\n", c); 23 | return NULL; 24 | } 25 | else if ((c == '\b' || c == '\x7f') && i > 0) 26 | { 27 | if (echoing) 28 | cputchar ('\b'); 29 | i--; 30 | } 31 | else if (c >= ' ' && i < BUFLEN - 1) 32 | { 33 | if (echoing) 34 | cputchar (c); 35 | buf[i++] = c; 36 | } 37 | else if (c == '\n' || c == '\r') 38 | { 39 | if (echoing) 40 | cputchar ('\n'); 41 | buf[i] = 0; 42 | return buf; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/syscall.c: -------------------------------------------------------------------------------- 1 | // System call stubs. 2 | 3 | #include 4 | #include 5 | 6 | static inline int32_t 7 | syscall (int num, int check, uint32_t a1, uint32_t a2, uint32_t a3, 8 | uint32_t a4, uint32_t a5) 9 | { 10 | int32_t ret; 11 | 12 | // Generic system call: pass system call number in AX, 13 | // up to five parameters in DX, CX, BX, DI, SI. 14 | // Interrupt kernel with T_SYSCALL. 15 | // 16 | // The "volatile" tells the assembler not to optimize 17 | // this instruction away just because we don't use the 18 | // return value. 19 | // 20 | // The last clause tells the assembler that this can 21 | // potentially change the condition codes and arbitrary 22 | // memory locations. 23 | 24 | asm volatile ("int %1\n":"=a" (ret):"i" (T_SYSCALL), 25 | "a" (num), 26 | "d" (a1), 27 | "c" (a2), "b" (a3), "D" (a4), "S" (a5):"cc", "memory"); 28 | 29 | if (check && ret > 0) 30 | panic ("syscall %d returned %d (> 0)\n", num, ret); 31 | 32 | return ret; 33 | } 34 | 35 | void 36 | sys_cputs (const char *s, size_t len) 37 | { 38 | syscall (SYS_cputs, 0, (uint32_t) s, len, 0, 0, 0); 39 | } 40 | 41 | int 42 | sys_cgetc (void) 43 | { 44 | return syscall (SYS_cgetc, 0, 0, 0, 0, 0, 0); 45 | } 46 | 47 | int 48 | sys_env_destroy (envid_t envid) 49 | { 50 | return syscall (SYS_env_destroy, 1, envid, 0, 0, 0, 0); 51 | } 52 | 53 | envid_t 54 | sys_getenvid (void) 55 | { 56 | return syscall (SYS_getenvid, 0, 0, 0, 0, 0, 0); 57 | } 58 | 59 | void 60 | sys_yield(void) 61 | { 62 | syscall(SYS_yield, 0, 0, 0, 0, 0, 0); 63 | } 64 | 65 | int 66 | sys_page_alloc(envid_t envid, void *va, int perm) 67 | { 68 | return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0); 69 | } 70 | 71 | int 72 | sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm) 73 | { 74 | return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm); 75 | } 76 | 77 | int 78 | sys_page_unmap(envid_t envid, void *va) 79 | { 80 | return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0); 81 | } 82 | 83 | // sys_exofork is inlined in lib.h 84 | 85 | int 86 | sys_env_set_status(envid_t envid, int status) 87 | { 88 | return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0); 89 | } 90 | 91 | int 92 | sys_env_set_pgfault_upcall(envid_t envid, void *upcall) 93 | { 94 | return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0); 95 | } 96 | 97 | int 98 | sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm) 99 | { 100 | return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0); 101 | } 102 | 103 | int 104 | sys_ipc_recv(void *dstva) 105 | { 106 | return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0); 107 | } 108 | 109 | -------------------------------------------------------------------------------- /mergedep.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Copyright 2003 Bryan Ford 3 | # Distributed under the GNU General Public License. 4 | # 5 | # Usage: mergedep [ ...] 6 | # 7 | # This script merges the contents of all specified 8 | # on the command line into the single file , 9 | # which may or may not previously exist. 10 | # Dependencies in the will override 11 | # any existing dependencies for the same targets in . 12 | # The are deleted after is updated. 13 | # 14 | # The are typically generated by GCC with the -MD option, 15 | # and the is typically included from a Makefile, 16 | # as shown here for GNU 'make': 17 | # 18 | # .deps: $(wildcard *.d) 19 | # perl mergedep $@ $^ 20 | # -include .deps 21 | # 22 | # This script properly handles multiple dependencies per , 23 | # including dependencies having no target, 24 | # so it is compatible with GCC3's -MP option. 25 | # 26 | 27 | sub readdeps { 28 | my $filename = shift; 29 | 30 | open(DEPFILE, $filename) or return 0; 31 | while () { 32 | if (/([^:]*):([^\\:]*)([\\]?)$/) { 33 | my $target = $1; 34 | my $deplines = $2; 35 | my $slash = $3; 36 | while ($slash ne '') { 37 | $_ = ; 38 | defined($_) or die 39 | "Unterminated dependency in $filename"; 40 | /(^[ \t][^\\]*)([\\]?)$/ or die 41 | "Bad continuation line in $filename"; 42 | $deplines = "$deplines\\\n$1"; 43 | $slash = $2; 44 | } 45 | #print "DEPENDENCY [[$target]]: [[$deplines]]\n"; 46 | $dephash{$target} = $deplines; 47 | } elsif (/^[#]?[ \t]*$/) { 48 | # ignore blank lines and comments 49 | } else { 50 | die "Bad dependency line in $filename: $_"; 51 | } 52 | } 53 | close DEPFILE; 54 | return 1; 55 | } 56 | 57 | 58 | if ($#ARGV < 0) { 59 | print "Usage: mergedep [ ..]\n"; 60 | exit(1); 61 | } 62 | 63 | %dephash = (); 64 | 65 | # Read the main dependency file 66 | $maindeps = $ARGV[0]; 67 | readdeps($maindeps); 68 | 69 | # Read and merge in the new dependency files 70 | foreach $i (1 .. $#ARGV) { 71 | readdeps($ARGV[$i]) or die "Can't open $ARGV[$i]"; 72 | } 73 | 74 | # Update the main dependency file 75 | open(DEPFILE, ">$maindeps.tmp") or die "Can't open output file $maindeps.tmp"; 76 | foreach $target (keys %dephash) { 77 | print DEPFILE "$target:$dephash{$target}"; 78 | } 79 | close DEPFILE; 80 | rename("$maindeps.tmp", "$maindeps") or die "Can't overwrite $maindeps"; 81 | 82 | # Finally, delete the new dependency files 83 | foreach $i (1 .. $#ARGV) { 84 | unlink($ARGV[$i]) or print "Error removing $ARGV[$i]\n"; 85 | } 86 | 87 | -------------------------------------------------------------------------------- /qemu-bin/bin/qemu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/bin/qemu -------------------------------------------------------------------------------- /qemu-bin/bin/qemu-ga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/bin/qemu-ga -------------------------------------------------------------------------------- /qemu-bin/bin/qemu-img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/bin/qemu-img -------------------------------------------------------------------------------- /qemu-bin/bin/qemu-io: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/bin/qemu-io -------------------------------------------------------------------------------- /qemu-bin/bin/qemu-nbd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/bin/qemu-nbd -------------------------------------------------------------------------------- /qemu-bin/bin/qemu-system-arm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/bin/qemu-system-arm -------------------------------------------------------------------------------- /qemu-bin/bin/qemu-system-x86_64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/bin/qemu-system-x86_64 -------------------------------------------------------------------------------- /qemu-bin/etc/qemu/target-x86_64.conf: -------------------------------------------------------------------------------- 1 | # x86 CPU MODELS 2 | 3 | [cpudef] 4 | name = "Conroe" 5 | level = "2" 6 | vendor = "GenuineIntel" 7 | family = "6" 8 | model = "2" 9 | stepping = "3" 10 | feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu mtrr clflush mca pse36" 11 | feature_ecx = "sse3 ssse3" 12 | extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu lm syscall nx" 13 | extfeature_ecx = "lahf_lm" 14 | xlevel = "0x8000000A" 15 | model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)" 16 | 17 | [cpudef] 18 | name = "Penryn" 19 | level = "2" 20 | vendor = "GenuineIntel" 21 | family = "6" 22 | model = "2" 23 | stepping = "3" 24 | feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu mtrr clflush mca pse36" 25 | feature_ecx = "sse3 cx16 ssse3 sse4.1" 26 | extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu lm syscall nx" 27 | extfeature_ecx = "lahf_lm" 28 | xlevel = "0x8000000A" 29 | model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)" 30 | 31 | [cpudef] 32 | name = "Nehalem" 33 | level = "2" 34 | vendor = "GenuineIntel" 35 | family = "6" 36 | model = "2" 37 | stepping = "3" 38 | feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu mtrr clflush mca pse36" 39 | feature_ecx = "sse3 cx16 ssse3 sse4.1 sse4.2 popcnt" 40 | extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu lm syscall nx" 41 | extfeature_ecx = "lahf_lm" 42 | xlevel = "0x8000000A" 43 | model_id = "Intel Core i7 9xx (Nehalem Class Core i7)" 44 | 45 | [cpudef] 46 | name = "Opteron_G1" 47 | level = "5" 48 | vendor = "AuthenticAMD" 49 | family = "15" 50 | model = "6" 51 | stepping = "1" 52 | feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu mtrr clflush mca pse36" 53 | feature_ecx = "sse3" 54 | extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu lm syscall nx" 55 | # extfeature_ecx = "" 56 | xlevel = "0x80000008" 57 | model_id = "AMD Opteron 240 (Gen 1 Class Opteron)" 58 | 59 | [cpudef] 60 | name = "Opteron_G2" 61 | level = "5" 62 | vendor = "AuthenticAMD" 63 | family = "15" 64 | model = "6" 65 | stepping = "1" 66 | feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu mtrr clflush mca pse36" 67 | feature_ecx = "sse3 cx16" 68 | extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu lm syscall nx rdtscp" 69 | extfeature_ecx = "svm lahf_lm" 70 | xlevel = "0x80000008" 71 | model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)" 72 | 73 | [cpudef] 74 | name = "Opteron_G3" 75 | level = "5" 76 | vendor = "AuthenticAMD" 77 | family = "15" 78 | model = "6" 79 | stepping = "1" 80 | feature_edx = "sse2 sse fxsr mmx pat cmov pge sep apic cx8 mce pae msr tsc pse de fpu mtrr clflush mca pse36" 81 | feature_ecx = "sse3 cx16 monitor popcnt" 82 | extfeature_edx = "fxsr mmx pat cmov pge apic cx8 mce pae msr tsc pse de fpu lm syscall nx rdtscp" 83 | extfeature_ecx = "svm sse4a abm misalignsse lahf_lm" 84 | xlevel = "0x80000008" 85 | model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)" 86 | 87 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/bamboo.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/bamboo.dtb -------------------------------------------------------------------------------- /qemu-bin/share/qemu/bios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/bios.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/ar: -------------------------------------------------------------------------------- 1 | # generated from XKB map ar 2 | include common 3 | map 0x401 4 | exclam 0x02 shift 5 | at 0x03 shift 6 | numbersign 0x04 shift 7 | dollar 0x05 shift 8 | percent 0x06 shift 9 | asciicircum 0x07 shift 10 | ampersand 0x08 shift 11 | asterisk 0x09 shift 12 | parenleft 0x0a shift 13 | parenright 0x0b shift 14 | minus 0x0c 15 | underscore 0x0c shift 16 | equal 0x0d 17 | plus 0x0d shift 18 | Arabic_dad 0x10 altgr 19 | Arabic_fatha 0x10 shift altgr 20 | Arabic_sad 0x11 altgr 21 | Arabic_fathatan 0x11 shift altgr 22 | Arabic_theh 0x12 altgr 23 | Arabic_damma 0x12 shift altgr 24 | Arabic_qaf 0x13 altgr 25 | Arabic_dammatan 0x13 shift altgr 26 | Arabic_feh 0x14 altgr 27 | UFEF9 0x14 shift altgr 28 | Arabic_ghain 0x15 altgr 29 | Arabic_hamzaunderalef 0x15 shift altgr 30 | Arabic_ain 0x16 altgr 31 | grave 0x16 shift altgr 32 | Arabic_ha 0x17 altgr 33 | division 0x17 shift altgr 34 | Arabic_khah 0x18 altgr 35 | multiply 0x18 shift altgr 36 | Arabic_hah 0x19 altgr 37 | Arabic_semicolon 0x19 shift altgr 38 | bracketleft 0x1a 39 | braceleft 0x1a shift 40 | Arabic_jeem 0x1a altgr 41 | bracketright 0x1b 42 | braceright 0x1b shift 43 | Arabic_dal 0x1b altgr 44 | Arabic_sheen 0x1e altgr 45 | backslash 0x1e shift altgr 46 | Arabic_seen 0x1f altgr 47 | Arabic_yeh 0x20 altgr 48 | bracketleft 0x20 shift altgr 49 | Arabic_beh 0x21 altgr 50 | bracketright 0x21 shift altgr 51 | Arabic_lam 0x22 altgr 52 | UFEF7 0x22 shift altgr 53 | Arabic_alef 0x23 altgr 54 | Arabic_hamzaonalef 0x23 shift altgr 55 | Arabic_teh 0x24 altgr 56 | Arabic_tatweel 0x24 shift altgr 57 | Arabic_noon 0x25 altgr 58 | Arabic_comma 0x25 shift altgr 59 | Arabic_meem 0x26 altgr 60 | slash 0x26 shift altgr 61 | semicolon 0x27 62 | colon 0x27 shift 63 | Arabic_kaf 0x27 altgr 64 | apostrophe 0x28 65 | quotedbl 0x28 shift 66 | Arabic_tah 0x28 altgr 67 | grave 0x29 68 | asciitilde 0x29 shift 69 | Arabic_thal 0x29 altgr 70 | Arabic_shadda 0x29 shift altgr 71 | backslash 0x2b 72 | bar 0x2b shift 73 | less 0x2b altgr 74 | greater 0x2b shift altgr 75 | Arabic_hamzaonyeh 0x2c altgr 76 | asciitilde 0x2c shift altgr 77 | Arabic_hamza 0x2d altgr 78 | Arabic_sukun 0x2d shift altgr 79 | Arabic_hamzaonwaw 0x2e altgr 80 | Arabic_kasra 0x2e shift altgr 81 | Arabic_ra 0x2f altgr 82 | Arabic_kasratan 0x2f shift altgr 83 | UFEFB 0x30 altgr 84 | UFEF5 0x30 shift altgr 85 | Arabic_alefmaksura 0x31 altgr 86 | Arabic_maddaonalef 0x31 shift altgr 87 | Arabic_tehmarbuta 0x32 altgr 88 | apostrophe 0x32 shift altgr 89 | comma 0x33 90 | less 0x33 shift 91 | Arabic_waw 0x33 altgr 92 | period 0x34 93 | greater 0x34 shift 94 | Arabic_zain 0x34 altgr 95 | slash 0x35 96 | question 0x35 shift 97 | Arabic_zah 0x35 altgr 98 | Arabic_question_mark 0x35 shift altgr 99 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/common: -------------------------------------------------------------------------------- 1 | include modifiers 2 | 3 | # 4 | # Top row 5 | # 6 | 1 0x2 7 | 2 0x3 8 | 3 0x4 9 | 4 0x5 10 | 5 0x6 11 | 6 0x7 12 | 7 0x8 13 | 8 0x9 14 | 9 0xa 15 | 0 0xb 16 | BackSpace 0xe 17 | 18 | # 19 | # QWERTY first row 20 | # 21 | Tab 0xf localstate 22 | ISO_Left_Tab 0xf shift 23 | q 0x10 addupper 24 | w 0x11 addupper 25 | e 0x12 addupper 26 | r 0x13 addupper 27 | t 0x14 addupper 28 | y 0x15 addupper 29 | u 0x16 addupper 30 | i 0x17 addupper 31 | o 0x18 addupper 32 | p 0x19 addupper 33 | 34 | # 35 | # QWERTY second row 36 | # 37 | a 0x1e addupper 38 | s 0x1f addupper 39 | d 0x20 addupper 40 | f 0x21 addupper 41 | g 0x22 addupper 42 | h 0x23 addupper 43 | j 0x24 addupper 44 | k 0x25 addupper 45 | l 0x26 addupper 46 | Return 0x1c localstate 47 | 48 | # 49 | # QWERTY third row 50 | # 51 | z 0x2c addupper 52 | x 0x2d addupper 53 | c 0x2e addupper 54 | v 0x2f addupper 55 | b 0x30 addupper 56 | n 0x31 addupper 57 | m 0x32 addupper 58 | 59 | space 0x39 localstate 60 | 61 | less 0x56 62 | greater 0x56 shift 63 | bar 0x56 altgr 64 | brokenbar 0x56 shift altgr 65 | 66 | # 67 | # Esc and Function keys 68 | # 69 | Escape 0x1 localstate 70 | F1 0x3b localstate 71 | F2 0x3c localstate 72 | F3 0x3d localstate 73 | F4 0x3e localstate 74 | F5 0x3f localstate 75 | F6 0x40 localstate 76 | F7 0x41 localstate 77 | F8 0x42 localstate 78 | F9 0x43 localstate 79 | F10 0x44 localstate 80 | F11 0x57 localstate 81 | F12 0x58 localstate 82 | 83 | # Printscreen, Scrollock and Pause 84 | # Printscreen really requires four scancodes (0xe0, 0x2a, 0xe0, 0x37), 85 | # but (0xe0, 0x37) seems to work. 86 | Print 0xb7 localstate 87 | Sys_Req 0xb7 localstate 88 | Execute 0xb7 localstate 89 | Scroll_Lock 0x46 90 | 91 | # 92 | # Insert - PgDown 93 | # 94 | Insert 0xd2 localstate 95 | Delete 0xd3 localstate 96 | Home 0xc7 localstate 97 | End 0xcf localstate 98 | Page_Up 0xc9 localstate 99 | Page_Down 0xd1 localstate 100 | 101 | # 102 | # Arrow keys 103 | # 104 | Left 0xcb localstate 105 | Up 0xc8 localstate 106 | Down 0xd0 localstate 107 | Right 0xcd localstate 108 | 109 | # 110 | # Numpad 111 | # 112 | Num_Lock 0x45 113 | KP_Divide 0xb5 114 | KP_Multiply 0x37 115 | KP_Subtract 0x4a 116 | KP_Add 0x4e 117 | KP_Enter 0x9c 118 | 119 | KP_Decimal 0x53 numlock 120 | KP_Separator 0x53 numlock 121 | KP_Delete 0x53 122 | 123 | KP_0 0x52 numlock 124 | KP_Insert 0x52 125 | 126 | KP_1 0x4f numlock 127 | KP_End 0x4f 128 | 129 | KP_2 0x50 numlock 130 | KP_Down 0x50 131 | 132 | KP_3 0x51 numlock 133 | KP_Next 0x51 134 | 135 | KP_4 0x4b numlock 136 | KP_Left 0x4b 137 | 138 | KP_5 0x4c numlock 139 | KP_Begin 0x4c 140 | 141 | KP_6 0x4d numlock 142 | KP_Right 0x4d 143 | 144 | KP_7 0x47 numlock 145 | KP_Home 0x47 146 | 147 | KP_8 0x48 numlock 148 | KP_Up 0x48 149 | 150 | KP_9 0x49 numlock 151 | KP_Prior 0x49 152 | 153 | Caps_Lock 0x3a 154 | # 155 | # Inhibited keys 156 | # 157 | Multi_key 0x0 inhibit 158 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/da: -------------------------------------------------------------------------------- 1 | # generated from XKB map dk 2 | include common 3 | map 0x406 4 | exclam 0x02 shift 5 | exclamdown 0x02 altgr 6 | onesuperior 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | at 0x03 altgr 9 | twosuperior 0x03 shift altgr 10 | numbersign 0x04 shift 11 | sterling 0x04 altgr 12 | threesuperior 0x04 shift altgr 13 | currency 0x05 shift 14 | dollar 0x05 altgr 15 | onequarter 0x05 shift altgr 16 | percent 0x06 shift 17 | onehalf 0x06 altgr 18 | cent 0x06 shift altgr 19 | ampersand 0x07 shift 20 | yen 0x07 altgr 21 | fiveeighths 0x07 shift altgr 22 | slash 0x08 shift 23 | braceleft 0x08 altgr 24 | division 0x08 shift altgr 25 | parenleft 0x09 shift 26 | bracketleft 0x09 altgr 27 | guillemotleft 0x09 shift altgr 28 | parenright 0x0a shift 29 | bracketright 0x0a altgr 30 | guillemotright 0x0a shift altgr 31 | equal 0x0b shift 32 | braceright 0x0b altgr 33 | degree 0x0b shift altgr 34 | plus 0x0c 35 | question 0x0c shift 36 | plusminus 0x0c altgr 37 | questiondown 0x0c shift altgr 38 | dead_acute 0x0d 39 | dead_grave 0x0d shift 40 | bar 0x0d altgr 41 | brokenbar 0x0d shift altgr 42 | Greek_OMEGA 0x10 shift altgr 43 | lstroke 0x11 altgr 44 | Lstroke 0x11 shift altgr 45 | EuroSign 0x12 altgr 46 | cent 0x12 shift altgr 47 | registered 0x13 altgr 48 | thorn 0x14 altgr 49 | THORN 0x14 shift altgr 50 | leftarrow 0x15 altgr 51 | yen 0x15 shift altgr 52 | downarrow 0x16 altgr 53 | uparrow 0x16 shift altgr 54 | rightarrow 0x17 altgr 55 | idotless 0x17 shift altgr 56 | oe 0x18 altgr 57 | OE 0x18 shift altgr 58 | thorn 0x19 altgr 59 | THORN 0x19 shift altgr 60 | aring 0x1a 61 | Aring 0x1a shift 62 | dead_diaeresis 0x1a altgr 63 | dead_abovering 0x1a shift altgr 64 | dead_diaeresis 0x1b 65 | dead_circumflex 0x1b shift 66 | dead_tilde 0x1b altgr 67 | dead_caron 0x1b shift altgr 68 | ordfeminine 0x1e altgr 69 | masculine 0x1e shift altgr 70 | ssharp 0x1f altgr 71 | section 0x1f shift altgr 72 | eth 0x20 altgr 73 | ETH 0x20 shift altgr 74 | dstroke 0x21 altgr 75 | ordfeminine 0x21 shift altgr 76 | eng 0x22 altgr 77 | ENG 0x22 shift altgr 78 | hstroke 0x23 altgr 79 | Hstroke 0x23 shift altgr 80 | kra 0x25 altgr 81 | lstroke 0x26 altgr 82 | Lstroke 0x26 shift altgr 83 | ae 0x27 84 | AE 0x27 shift 85 | oslash 0x28 86 | Ooblique 0x28 shift 87 | dead_caron 0x28 shift altgr 88 | onehalf 0x29 89 | section 0x29 shift 90 | threequarters 0x29 altgr 91 | paragraph 0x29 shift altgr 92 | apostrophe 0x2b 93 | asterisk 0x2b shift 94 | dead_doubleacute 0x2b altgr 95 | multiply 0x2b shift altgr 96 | guillemotleft 0x2c altgr 97 | guillemotright 0x2d altgr 98 | copyright 0x2e altgr 99 | leftdoublequotemark 0x2f altgr 100 | grave 0x2f shift altgr 101 | rightdoublequotemark 0x30 altgr 102 | mu 0x32 altgr 103 | masculine 0x32 shift altgr 104 | comma 0x33 105 | semicolon 0x33 shift 106 | dead_cedilla 0x33 altgr 107 | dead_ogonek 0x33 shift altgr 108 | period 0x34 109 | colon 0x34 shift 110 | periodcentered 0x34 altgr 111 | dead_abovedot 0x34 shift altgr 112 | minus 0x35 113 | underscore 0x35 shift 114 | hyphen 0x35 altgr 115 | macron 0x35 shift altgr 116 | nobreakspace 0x39 altgr 117 | less 0x56 118 | greater 0x56 shift 119 | backslash 0x56 altgr 120 | notsign 0x56 shift altgr 121 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/de: -------------------------------------------------------------------------------- 1 | # generated from XKB map de 2 | include common 3 | map 0x407 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | twosuperior 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | section 0x04 shift 11 | threesuperior 0x04 altgr 12 | sterling 0x04 shift altgr 13 | dollar 0x05 shift 14 | onequarter 0x05 altgr 15 | currency 0x05 shift altgr 16 | percent 0x06 shift 17 | onehalf 0x06 altgr 18 | threeeighths 0x06 shift altgr 19 | ampersand 0x07 shift 20 | threequarters 0x07 altgr 21 | fiveeighths 0x07 shift altgr 22 | slash 0x08 shift 23 | braceleft 0x08 altgr 24 | seveneighths 0x08 shift altgr 25 | parenleft 0x09 shift 26 | bracketleft 0x09 altgr 27 | trademark 0x09 shift altgr 28 | parenright 0x0a shift 29 | bracketright 0x0a altgr 30 | plusminus 0x0a shift altgr 31 | equal 0x0b shift 32 | braceright 0x0b altgr 33 | ssharp 0x0c 34 | question 0x0c shift 35 | backslash 0x0c altgr 36 | questiondown 0x0c shift altgr 37 | acute 0x0d 38 | dead_acute 0x0d 39 | grave 0x0d shift 40 | dead_grave 0x0d shift 41 | dead_cedilla 0x0d altgr 42 | dead_ogonek 0x0d shift altgr 43 | at 0x10 altgr 44 | Greek_OMEGA 0x10 shift altgr 45 | EuroSign 0x12 altgr 46 | paragraph 0x13 altgr 47 | registered 0x13 shift altgr 48 | tslash 0x14 altgr 49 | Tslash 0x14 shift altgr 50 | z 0x15 addupper 51 | leftarrow 0x15 altgr 52 | yen 0x15 shift altgr 53 | downarrow 0x16 altgr 54 | uparrow 0x16 shift altgr 55 | rightarrow 0x17 altgr 56 | idotless 0x17 shift altgr 57 | oslash 0x18 altgr 58 | Ooblique 0x18 shift altgr 59 | thorn 0x19 altgr 60 | THORN 0x19 shift altgr 61 | udiaeresis 0x1a 62 | Udiaeresis 0x1a shift 63 | dead_diaeresis 0x1a altgr 64 | dead_abovering 0x1a shift altgr 65 | plus 0x1b 66 | asterisk 0x1b shift 67 | asciitilde 0x1b altgr 68 | dead_tilde 0x1b altgr 69 | dead_macron 0x1b shift altgr 70 | ae 0x1e altgr 71 | AE 0x1e shift altgr 72 | eth 0x20 altgr 73 | ETH 0x20 shift altgr 74 | dstroke 0x21 altgr 75 | ordfeminine 0x21 shift altgr 76 | eng 0x22 altgr 77 | ENG 0x22 shift altgr 78 | hstroke 0x23 altgr 79 | Hstroke 0x23 shift altgr 80 | kra 0x25 altgr 81 | odiaeresis 0x27 82 | Odiaeresis 0x27 shift 83 | dead_doubleacute 0x27 altgr 84 | adiaeresis 0x28 85 | Adiaeresis 0x28 shift 86 | dead_caron 0x28 shift altgr 87 | asciicircum 0x29 88 | dead_circumflex 0x29 89 | degree 0x29 shift 90 | notsign 0x29 altgr 91 | numbersign 0x2b 92 | apostrophe 0x2b shift 93 | dead_breve 0x2b shift altgr 94 | y 0x2c addupper 95 | guillemotleft 0x2c altgr 96 | guillemotright 0x2d altgr 97 | cent 0x2e altgr 98 | copyright 0x2e shift altgr 99 | leftdoublequotemark 0x2f altgr 100 | rightdoublequotemark 0x30 altgr 101 | mu 0x32 altgr 102 | masculine 0x32 shift altgr 103 | comma 0x33 104 | semicolon 0x33 shift 105 | horizconnector 0x33 altgr 106 | multiply 0x33 shift altgr 107 | period 0x34 108 | colon 0x34 shift 109 | periodcentered 0x34 altgr 110 | division 0x34 shift altgr 111 | minus 0x35 112 | underscore 0x35 shift 113 | dead_belowdot 0x35 altgr 114 | dead_abovedot 0x35 shift altgr 115 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/de-ch: -------------------------------------------------------------------------------- 1 | # rdesktop Swiss-German (de-ch) keymap file 2 | # 2003-06-03 by noldi@tristar.ch 3 | # 4 | include common 5 | map 0x00000807 6 | # 7 | # Scan Code 1 8 | section 0x29 9 | degree 0x29 shift 10 | notsign 0x29 altgr inhibit 11 | # 12 | # Scan Code 2 13 | plus 0x2 shift 14 | brokenbar 0x02 altgr 15 | # 16 | # Scan Code 3 17 | quotedbl 0x03 shift 18 | at 0x03 altgr 19 | # 20 | # Scan Code 4 21 | asterisk 0x04 shift 22 | numbersign 0x04 altgr 23 | # 24 | # Scan Code 5 25 | ccedilla 0x05 shift 26 | onequarter 0x05 altgr inhibit 27 | # 28 | # Scan Code 6 29 | percent 0x06 shift 30 | onehalf 0x06 altgr inhibit 31 | # 32 | # Scan Code 7 33 | ampersand 0x07 shift 34 | notsign 0x07 altgr 35 | # 36 | # Scan Code 8 37 | slash 0x08 shift 38 | bar 0x08 altgr 39 | # 40 | # Scan Code 9 41 | parenleft 0x09 shift 42 | cent 0x09 altgr 43 | # 44 | # Scan Code 10 45 | parenright 0x0a shift 46 | # 47 | # Scan Code 11 48 | equal 0x0b shift 49 | braceright 0x0b altgr inhibit 50 | # 51 | # Scan Code 12 52 | apostrophe 0x0c 53 | question 0x0c shift 54 | dead_acute 0x0c altgr 55 | # 56 | # Scan Code 13 57 | dead_circumflex 0x0d 58 | dead_grave 0x0d shift 59 | dead_tilde 0x0d altgr 60 | # 61 | # Scan Code 19 62 | EuroSign 0x12 altgr 63 | # 64 | # Scan Code 22 65 | z 0x15 addupper 66 | # 67 | # Scan Code 27 68 | udiaeresis 0x1a 69 | egrave 0x1a shift 70 | bracketleft 0x1a altgr 71 | # 72 | # Scan Code 28 73 | dead_diaeresis 0x1b 74 | exclam 0x1b shift 75 | bracketright 0x1b altgr 76 | # 77 | # Scan Code 40 78 | odiaeresis 0x27 79 | eacute 0x27 shift 80 | # 81 | # Scan Code 41 82 | adiaeresis 0x28 83 | agrave 0x28 shift 84 | braceleft 0x28 altgr 85 | # 86 | # Scan Code 42 (only on international keyboards) 87 | dollar 0x2b 88 | sterling 0x2b shift 89 | braceright 0x2b altgr 90 | # 91 | # Scan Code 45 (only on international keyboards) 92 | backslash 0x56 altgr 93 | # 94 | # Scan Code 46 95 | y 0x2c addupper 96 | # 97 | # Scan Code 53 98 | comma 0x33 99 | semicolon 0x33 shift 100 | # 101 | # Scan Code 54 102 | period 0x34 103 | colon 0x34 shift 104 | # 105 | # Scan Code 55 106 | minus 0x35 107 | underscore 0x35 shift 108 | # 109 | # Suppress Windows unsupported AltGr keys 110 | # 111 | # Scan Code 17 112 | paragraph 0x10 altgr inhibit 113 | # 114 | # Scan Code 21 115 | tslash 0x14 altgr inhibit 116 | # 117 | # Scan Code 22 118 | leftarrow 0x15 altgr inhibit 119 | # 120 | # Scan Code 23 121 | downarrow 0x16 altgr inhibit 122 | # 123 | # Scan Code 24 124 | rightarrow 0x17 altgr inhibit 125 | # 126 | # Scan Code 25 127 | oslash 0x18 altgr inhibit 128 | # 129 | # Scan Code 26 130 | thorn 0x19 altgr inhibit 131 | # 132 | # Scan Code 31 133 | ae 0x1e altgr inhibit 134 | # 135 | # Scan Code 32 136 | ssharp 0x1f altgr inhibit 137 | # 138 | # Scan Code 33 139 | eth 0x20 altgr inhibit 140 | # 141 | # Scan Code 34 142 | dstroke 0x21 altgr inhibit 143 | # 144 | # Scan Code 35 145 | eng 0x22 altgr inhibit 146 | # 147 | # Scan Code 36 148 | hstroke 0x23 altgr inhibit 149 | # 150 | # Scan Code 38 151 | kra 0x25 altgr inhibit 152 | # 153 | # Scan Code 39 154 | lstroke 0x26 altgr inhibit 155 | # 156 | # Scan Code 46 157 | guillemotleft 0x2c altgr inhibit 158 | # 159 | # Scan Code 47 160 | guillemotright 0x2d altgr inhibit 161 | # 162 | # Scan Code 49 163 | leftdoublequotemark 0x2f altgr inhibit 164 | # 165 | # Scan Code 50 166 | rightdoublequotemark 0x30 altgr inhibit 167 | # 168 | # Scan Code 52 169 | mu 0x32 altgr inhibit 170 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/en-gb: -------------------------------------------------------------------------------- 1 | # generated from XKB map gb 2 | include common 3 | map 0x809 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | twosuperior 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | sterling 0x04 shift 11 | threesuperior 0x04 altgr 12 | dollar 0x05 shift 13 | EuroSign 0x05 altgr 14 | percent 0x06 shift 15 | onehalf 0x06 altgr 16 | threeeighths 0x06 shift altgr 17 | asciicircum 0x07 shift 18 | threequarters 0x07 altgr 19 | fiveeighths 0x07 shift altgr 20 | ampersand 0x08 shift 21 | braceleft 0x08 altgr 22 | seveneighths 0x08 shift altgr 23 | asterisk 0x09 shift 24 | bracketleft 0x09 altgr 25 | trademark 0x09 shift altgr 26 | parenleft 0x0a shift 27 | bracketright 0x0a altgr 28 | plusminus 0x0a shift altgr 29 | parenright 0x0b shift 30 | braceright 0x0b altgr 31 | degree 0x0b shift altgr 32 | minus 0x0c 33 | underscore 0x0c shift 34 | backslash 0x0c altgr 35 | questiondown 0x0c shift altgr 36 | equal 0x0d 37 | plus 0x0d shift 38 | dead_cedilla 0x0d altgr 39 | dead_ogonek 0x0d shift altgr 40 | at 0x10 altgr 41 | Greek_OMEGA 0x10 shift altgr 42 | lstroke 0x11 altgr 43 | Lstroke 0x11 shift altgr 44 | paragraph 0x13 altgr 45 | registered 0x13 shift altgr 46 | tslash 0x14 altgr 47 | Tslash 0x14 shift altgr 48 | leftarrow 0x15 altgr 49 | yen 0x15 shift altgr 50 | downarrow 0x16 altgr 51 | uparrow 0x16 shift altgr 52 | rightarrow 0x17 altgr 53 | idotless 0x17 shift altgr 54 | oslash 0x18 altgr 55 | Ooblique 0x18 shift altgr 56 | thorn 0x19 altgr 57 | THORN 0x19 shift altgr 58 | bracketleft 0x1a 59 | braceleft 0x1a shift 60 | dead_diaeresis 0x1a altgr 61 | dead_abovering 0x1a shift altgr 62 | bracketright 0x1b 63 | braceright 0x1b shift 64 | dead_tilde 0x1b altgr 65 | dead_macron 0x1b shift altgr 66 | ae 0x1e altgr 67 | AE 0x1e shift altgr 68 | ssharp 0x1f altgr 69 | section 0x1f shift altgr 70 | eth 0x20 altgr 71 | ETH 0x20 shift altgr 72 | dstroke 0x21 altgr 73 | ordfeminine 0x21 shift altgr 74 | eng 0x22 altgr 75 | ENG 0x22 shift altgr 76 | hstroke 0x23 altgr 77 | Hstroke 0x23 shift altgr 78 | kra 0x25 altgr 79 | lstroke 0x26 altgr 80 | Lstroke 0x26 shift altgr 81 | semicolon 0x27 82 | colon 0x27 shift 83 | dead_acute 0x27 altgr 84 | dead_doubleacute 0x27 shift altgr 85 | apostrophe 0x28 86 | at 0x28 shift 87 | dead_circumflex 0x28 altgr 88 | dead_caron 0x28 shift altgr 89 | grave 0x29 90 | notsign 0x29 shift 91 | bar 0x29 altgr 92 | numbersign 0x2b 93 | asciitilde 0x2b shift 94 | dead_grave 0x2b altgr 95 | dead_breve 0x2b shift altgr 96 | guillemotleft 0x2c altgr 97 | less 0x2c shift altgr 98 | guillemotright 0x2d altgr 99 | greater 0x2d shift altgr 100 | cent 0x2e altgr 101 | copyright 0x2e shift altgr 102 | leftdoublequotemark 0x2f altgr 103 | rightdoublequotemark 0x30 altgr 104 | mu 0x32 altgr 105 | masculine 0x32 shift altgr 106 | comma 0x33 107 | less 0x33 shift 108 | horizconnector 0x33 altgr 109 | multiply 0x33 shift altgr 110 | period 0x34 111 | greater 0x34 shift 112 | periodcentered 0x34 altgr 113 | division 0x34 shift altgr 114 | slash 0x35 115 | question 0x35 shift 116 | dead_belowdot 0x35 altgr 117 | dead_abovedot 0x35 shift altgr 118 | backslash 0x56 119 | bar 0x56 shift 120 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/en-us: -------------------------------------------------------------------------------- 1 | # generated from XKB map us 2 | include common 3 | map 0x409 4 | exclam 0x02 shift 5 | at 0x03 shift 6 | numbersign 0x04 shift 7 | dollar 0x05 shift 8 | percent 0x06 shift 9 | asciicircum 0x07 shift 10 | ampersand 0x08 shift 11 | asterisk 0x09 shift 12 | parenleft 0x0a shift 13 | parenright 0x0b shift 14 | minus 0x0c 15 | underscore 0x0c shift 16 | equal 0x0d 17 | plus 0x0d shift 18 | bracketleft 0x1a 19 | braceleft 0x1a shift 20 | bracketright 0x1b 21 | braceright 0x1b shift 22 | semicolon 0x27 23 | colon 0x27 shift 24 | apostrophe 0x28 25 | quotedbl 0x28 shift 26 | grave 0x29 27 | asciitilde 0x29 shift 28 | backslash 0x2b 29 | bar 0x2b shift 30 | comma 0x33 31 | less 0x33 shift 32 | period 0x34 33 | greater 0x34 shift 34 | slash 0x35 35 | question 0x35 shift 36 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/es: -------------------------------------------------------------------------------- 1 | # generated from XKB map es 2 | include common 3 | map 0x40a 4 | exclam 0x02 shift 5 | bar 0x02 altgr 6 | quotedbl 0x03 shift 7 | at 0x03 altgr 8 | oneeighth 0x03 shift altgr 9 | periodcentered 0x04 shift 10 | numbersign 0x04 altgr 11 | sterling 0x04 shift altgr 12 | dollar 0x05 shift 13 | asciitilde 0x05 altgr 14 | percent 0x06 shift 15 | onehalf 0x06 altgr 16 | threeeighths 0x06 shift altgr 17 | ampersand 0x07 shift 18 | notsign 0x07 altgr 19 | fiveeighths 0x07 shift altgr 20 | slash 0x08 shift 21 | seveneighths 0x08 shift altgr 22 | parenleft 0x09 shift 23 | trademark 0x09 shift altgr 24 | parenright 0x0a shift 25 | plusminus 0x0a shift altgr 26 | equal 0x0b shift 27 | degree 0x0b shift altgr 28 | apostrophe 0x0c 29 | question 0x0c shift 30 | exclamdown 0x0d 31 | questiondown 0x0d shift 32 | Greek_OMEGA 0x10 shift altgr 33 | lstroke 0x11 altgr 34 | Lstroke 0x11 shift altgr 35 | EuroSign 0x12 altgr 36 | paragraph 0x13 altgr 37 | registered 0x13 shift altgr 38 | tslash 0x14 altgr 39 | Tslash 0x14 shift altgr 40 | leftarrow 0x15 altgr 41 | yen 0x15 shift altgr 42 | downarrow 0x16 altgr 43 | uparrow 0x16 shift altgr 44 | rightarrow 0x17 altgr 45 | idotless 0x17 shift altgr 46 | oslash 0x18 altgr 47 | Ooblique 0x18 shift altgr 48 | thorn 0x19 altgr 49 | THORN 0x19 shift altgr 50 | dead_grave 0x1a 51 | dead_circumflex 0x1a shift 52 | bracketleft 0x1a altgr 53 | dead_abovering 0x1a shift altgr 54 | plus 0x1b 55 | asterisk 0x1b shift 56 | bracketright 0x1b altgr 57 | dead_macron 0x1b shift altgr 58 | ae 0x1e altgr 59 | AE 0x1e shift altgr 60 | ssharp 0x1f altgr 61 | section 0x1f shift altgr 62 | eth 0x20 altgr 63 | ETH 0x20 shift altgr 64 | dstroke 0x21 altgr 65 | eng 0x22 altgr 66 | ENG 0x22 shift altgr 67 | hstroke 0x23 altgr 68 | Hstroke 0x23 shift altgr 69 | kra 0x25 altgr 70 | lstroke 0x26 altgr 71 | Lstroke 0x26 shift altgr 72 | ntilde 0x27 73 | Ntilde 0x27 shift 74 | dead_doubleacute 0x27 shift altgr 75 | dead_acute 0x28 76 | dead_diaeresis 0x28 shift 77 | braceleft 0x28 altgr 78 | masculine 0x29 79 | ordfeminine 0x29 shift 80 | backslash 0x29 altgr 81 | ccedilla 0x2b 82 | Ccedilla 0x2b shift 83 | braceright 0x2b altgr 84 | dead_breve 0x2b shift altgr 85 | guillemotleft 0x2c altgr 86 | less 0x56 87 | greater 0x56 shift 88 | guillemotright 0x2d altgr 89 | cent 0x2e altgr 90 | copyright 0x2e shift altgr 91 | leftdoublequotemark 0x2f altgr 92 | grave 0x2f shift altgr 93 | rightdoublequotemark 0x30 altgr 94 | mu 0x32 altgr 95 | comma 0x33 96 | semicolon 0x33 shift 97 | horizconnector 0x33 altgr 98 | multiply 0x33 shift altgr 99 | period 0x34 100 | colon 0x34 shift 101 | division 0x34 shift altgr 102 | minus 0x35 103 | underscore 0x35 shift 104 | dead_belowdot 0x35 altgr 105 | dead_abovedot 0x35 shift altgr 106 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/et: -------------------------------------------------------------------------------- 1 | map 0x00000425 2 | include common 3 | 4 | # 5 | # Top row 6 | # 7 | dead_caron 0x29 8 | dead_tilde 0x29 shift 9 | 10 | # 1 11 | exclam 0x2 shift 12 | 13 | # 2 14 | quotedbl 0x3 shift 15 | at 0x3 altgr 16 | 17 | # 3 18 | numbersign 0x4 shift 19 | sterling 0x4 altgr 20 | # 4 21 | currency 0x5 shift 22 | dollar 0x5 altgr 23 | # 5 24 | percent 0x6 shift 25 | # 6 26 | ampersand 0x7 shift 27 | # 7 28 | slash 0x8 shift 29 | braceleft 0x8 altgr 30 | # 8 31 | parenleft 0x9 shift 32 | bracketleft 0x9 altgr 33 | # 9 34 | parenright 0xa shift 35 | bracketright 0xa altgr 36 | # 0 37 | equal 0xb shift 38 | braceright 0xb altgr 39 | 40 | plus 0xc 41 | question 0xc shift 42 | backslash 0xc altgr 43 | 44 | acute 0xd 45 | dead_acute 0xd 46 | grave 0xd shift 47 | dead_grave 0xd shift 48 | 49 | # 50 | # QWERTY first row 51 | # 52 | EuroSign 0x12 altgr 53 | udiaeresis 0x1a 54 | Udiaeresis 0x1a shift 55 | otilde 0x1b 56 | Otilde 0x1b shift 57 | section 0x1b altgr 58 | 59 | # 60 | # QWERTY second row 61 | # 62 | scaron 0x1f altgr 63 | Scaron 0x1f altgr shift 64 | odiaeresis 0x27 65 | Odiaeresis 0x27 shift 66 | adiaeresis 0x28 67 | Adiaeresis 0x28 shift 68 | asciicircum 0x28 altgr 69 | apostrophe 0x2b 70 | asterisk 0x2b shift 71 | onehalf 0x2b altgr 72 | # 73 | # QWERTY third row 74 | # 75 | less 0x56 76 | greater 0x56 shift 77 | bar 0x56 altgr 78 | zcaron 0x2c altgr 79 | Zcaron 0x2c altgr shift 80 | comma 0x33 81 | semicolon 0x33 shift 82 | period 0x34 83 | colon 0x34 shift 84 | minus 0x35 85 | underscore 0x35 shift 86 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/fi: -------------------------------------------------------------------------------- 1 | # generated from XKB map se_FI 2 | include common 3 | map 0x40b 4 | exclam 0x02 shift 5 | exclamdown 0x02 altgr 6 | onesuperior 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | at 0x03 altgr 9 | twosuperior 0x03 shift altgr 10 | numbersign 0x04 shift 11 | sterling 0x04 altgr 12 | threesuperior 0x04 shift altgr 13 | currency 0x05 shift 14 | dollar 0x05 altgr 15 | onequarter 0x05 shift altgr 16 | percent 0x06 shift 17 | onehalf 0x06 altgr 18 | cent 0x06 shift altgr 19 | ampersand 0x07 shift 20 | yen 0x07 altgr 21 | fiveeighths 0x07 shift altgr 22 | slash 0x08 shift 23 | braceleft 0x08 altgr 24 | division 0x08 shift altgr 25 | parenleft 0x09 shift 26 | bracketleft 0x09 altgr 27 | guillemotleft 0x09 shift altgr 28 | parenright 0x0a shift 29 | bracketright 0x0a altgr 30 | guillemotright 0x0a shift altgr 31 | equal 0x0b shift 32 | braceright 0x0b altgr 33 | degree 0x0b shift altgr 34 | plus 0x0c 35 | question 0x0c shift 36 | backslash 0x0c altgr 37 | questiondown 0x0c shift altgr 38 | dead_acute 0x0d 39 | dead_grave 0x0d shift 40 | plusminus 0x0d altgr 41 | notsign 0x0d shift altgr 42 | at 0x10 altgr 43 | Greek_OMEGA 0x10 shift altgr 44 | lstroke 0x11 altgr 45 | Lstroke 0x11 shift altgr 46 | EuroSign 0x12 altgr 47 | cent 0x12 shift altgr 48 | registered 0x13 altgr 49 | thorn 0x14 altgr 50 | THORN 0x14 shift altgr 51 | leftarrow 0x15 altgr 52 | yen 0x15 shift altgr 53 | downarrow 0x16 altgr 54 | uparrow 0x16 shift altgr 55 | rightarrow 0x17 altgr 56 | idotless 0x17 shift altgr 57 | oe 0x18 altgr 58 | OE 0x18 shift altgr 59 | thorn 0x19 altgr 60 | THORN 0x19 shift altgr 61 | aring 0x1a 62 | Aring 0x1a shift 63 | dead_diaeresis 0x1a altgr 64 | dead_abovering 0x1a shift altgr 65 | dead_diaeresis 0x1b 66 | dead_circumflex 0x1b shift 67 | dead_tilde 0x1b altgr 68 | dead_caron 0x1b shift altgr 69 | ordfeminine 0x1e altgr 70 | masculine 0x1e shift altgr 71 | ssharp 0x1f altgr 72 | section 0x1f shift altgr 73 | eth 0x20 altgr 74 | ETH 0x20 shift altgr 75 | dstroke 0x21 altgr 76 | ordfeminine 0x21 shift altgr 77 | eng 0x22 altgr 78 | ENG 0x22 shift altgr 79 | hstroke 0x23 altgr 80 | Hstroke 0x23 shift altgr 81 | kra 0x25 altgr 82 | ampersand 0x25 shift altgr 83 | lstroke 0x26 altgr 84 | Lstroke 0x26 shift altgr 85 | odiaeresis 0x27 86 | Odiaeresis 0x27 shift 87 | oslash 0x27 altgr 88 | Ooblique 0x27 shift altgr 89 | adiaeresis 0x28 90 | Adiaeresis 0x28 shift 91 | ae 0x28 altgr 92 | AE 0x28 shift altgr 93 | section 0x29 94 | onehalf 0x29 shift 95 | paragraph 0x29 altgr 96 | threequarters 0x29 shift altgr 97 | apostrophe 0x2b 98 | asterisk 0x2b shift 99 | acute 0x2b altgr 100 | multiply 0x2b shift altgr 101 | guillemotleft 0x2c altgr 102 | less 0x2c shift altgr 103 | guillemotright 0x2d altgr 104 | greater 0x2d shift altgr 105 | copyright 0x2e altgr 106 | leftdoublequotemark 0x2f altgr 107 | grave 0x2f shift altgr 108 | rightdoublequotemark 0x30 altgr 109 | apostrophe 0x30 shift altgr 110 | mu 0x32 altgr 111 | masculine 0x32 shift altgr 112 | comma 0x33 113 | semicolon 0x33 shift 114 | dead_cedilla 0x33 altgr 115 | dead_ogonek 0x33 shift altgr 116 | period 0x34 117 | colon 0x34 shift 118 | periodcentered 0x34 altgr 119 | dead_abovedot 0x34 shift altgr 120 | minus 0x35 121 | underscore 0x35 shift 122 | hyphen 0x35 altgr 123 | macron 0x35 shift altgr 124 | nobreakspace 0x39 altgr 125 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/fo: -------------------------------------------------------------------------------- 1 | map 0x438 2 | include common 3 | 4 | # 5 | # Top row 6 | # 7 | onehalf 0x29 8 | section 0x29 shift 9 | 10 | # 1 11 | exclam 0x2 shift 12 | 13 | # 2 14 | quotedbl 0x3 shift 15 | at 0x3 altgr 16 | 17 | # 3 18 | numbersign 0x4 shift 19 | sterling 0x4 altgr 20 | # 4 21 | currency 0x5 shift 22 | dollar 0x5 altgr 23 | # 5 24 | percent 0x6 shift 25 | # 6 26 | ampersand 0x7 shift 27 | # 7 28 | slash 0x8 shift 29 | braceleft 0x8 altgr 30 | # 8 31 | parenleft 0x9 shift 32 | bracketleft 0x9 altgr 33 | # 9 34 | parenright 0xa shift 35 | bracketright 0xa altgr 36 | # 0 37 | equal 0xb shift 38 | braceright 0xb altgr 39 | 40 | plus 0xc 41 | question 0xc shift 42 | plusminus 0xc altgr 43 | 44 | bar 0xd altgr 45 | dead_acute 0xd 46 | 47 | # 48 | # QWERTY first row 49 | # 50 | EuroSign 0x12 altgr 51 | aring 0x1a 52 | Aring 0x1a shift 53 | eth 0x1b addupper 54 | asciitilde 0x1b altgr 55 | 56 | # 57 | # QWERTY second row 58 | # 59 | ae 0x27 addupper 60 | oslash 0x28 61 | Ooblique 0x28 shift 62 | apostrophe 0x2b 63 | asterisk 0x2b shift 64 | 65 | # 66 | # QWERTY third row 67 | # 68 | less 0x56 69 | greater 0x56 shift 70 | backslash 0x56 altgr 71 | comma 0x33 72 | semicolon 0x33 shift 73 | period 0x34 74 | colon 0x34 shift 75 | minus 0x35 76 | underscore 0x35 shift 77 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/fr: -------------------------------------------------------------------------------- 1 | include common 2 | map 0x40c 3 | # 4 | # Top row 5 | # 6 | twosuperior 0x29 7 | notsign 0x29 altgr 8 | 9 | ampersand 0x02 10 | 1 0x02 shift 11 | onesuperior 0x02 altgr 12 | exclamdown 0x02 shift altgr 13 | 14 | eacute 0x03 15 | 2 0x03 shift 16 | asciitilde 0x03 altgr 17 | oneeighth 0x03 shift altgr 18 | 19 | quotedbl 0x04 20 | 3 0x04 shift 21 | numbersign 0x04 altgr 22 | 23 | apostrophe 0x05 24 | 4 0x05 shift 25 | braceleft 0x05 altgr 26 | 27 | parenleft 0x06 28 | 5 0x06 shift 29 | bracketleft 0x06 altgr 30 | threeeighths 0x06 shift altgr 31 | 32 | minus 0x07 33 | 6 0x07 shift 34 | bar 0x07 altgr 35 | fiveeighths 0x07 shift altgr 36 | 37 | egrave 0x08 38 | 7 0x08 shift 39 | grave 0x08 altgr 40 | seveneighths 0x08 shift altgr 41 | 42 | underscore 0x09 43 | 8 0x09 shift 44 | backslash 0x09 altgr 45 | trademark 0x09 shift altgr 46 | 47 | ccedilla 0x0a 48 | 9 0x0a shift 49 | asciicircum 0x0a altgr 50 | plusminus 0x0a shift altgr 51 | 52 | agrave 0x0b 53 | 0 0x0b shift 54 | at 0x0b altgr 55 | 56 | parenright 0x0c 57 | degree 0x0c shift 58 | bracketright 0x0c altgr 59 | questiondown 0x0c shift altgr 60 | 61 | equal 0x0d 62 | plus 0x0d shift 63 | braceright 0x0d altgr 64 | dead_ogonek 0x0d shift altgr 65 | 66 | # 67 | # AZERTY first row 68 | # 69 | 70 | a 0x10 addupper 71 | ae 0x10 altgr 72 | AE 0x10 shift altgr 73 | 74 | z 0x11 addupper 75 | guillemotleft 0x11 altgr 76 | 77 | EuroSign 0x12 altgr 78 | 79 | paragraph 0x13 altgr 80 | registered 0x13 shift altgr 81 | 82 | tslash 0x14 altgr 83 | Tslash 0x14 shift altgr 84 | 85 | leftarrow 0x15 altgr 86 | yen 0x15 shift altgr 87 | 88 | downarrow 0x16 altgr 89 | uparrow 0x16 shift altgr 90 | 91 | rightarrow 0x17 altgr 92 | idotless 0x17 shift altgr 93 | 94 | oslash 0x18 altgr 95 | Ooblique 0x18 shift altgr 96 | 97 | thorn 0x19 altgr 98 | THORN 0x19 shift altgr 99 | 100 | dead_circumflex 0x1a 101 | dead_diaeresis 0x1a shift 102 | dead_abovering 0x1a shift altgr 103 | 104 | dollar 0x1b 105 | sterling 0x1b shift 106 | currency 0x1b altgr 107 | dead_macron 0x1b shift altgr 108 | 109 | # 110 | # AZERTY second row 111 | # 112 | q 0x1e addupper 113 | Greek_OMEGA 0x1e shift altgr 114 | 115 | ssharp 0x1f altgr 116 | 117 | eth 0x20 altgr 118 | ETH 0x20 shift altgr 119 | 120 | dstroke 0x21 altgr 121 | ordfeminine 0x21 shift altgr 122 | 123 | eng 0x22 altgr 124 | ENG 0x22 shift altgr 125 | 126 | hstroke 0x23 altgr 127 | Hstroke 0x23 shift altgr 128 | 129 | kra 0x25 altgr 130 | 131 | lstroke 0x26 altgr 132 | Lstroke 0x26 shift altgr 133 | 134 | m 0x27 addupper 135 | masculine 0x27 shift altgr 136 | 137 | ugrave 0x28 138 | percent 0x28 shift 139 | dead_caron 0x28 shift altgr 140 | 141 | asterisk 0x2b 142 | mu 0x2b shift 143 | dead_grave 0x2b altgr 144 | dead_breve 0x2b shift altgr 145 | 146 | # 147 | # AZERTY third row 148 | # 149 | less 0x56 150 | greater 0x56 shift 151 | 152 | w 0x2c addupper 153 | 154 | guillemotright 0x2d altgr 155 | 156 | cent 0x2e altgr 157 | copyright 0x2e shift altgr 158 | 159 | leftdoublequotemark 0x2f altgr 160 | 161 | rightdoublequotemark 0x30 altgr 162 | 163 | comma 0x32 164 | question 0x32 shift 165 | dead_acute 0x32 altgr 166 | dead_doubleacute 0x32 shift altgr 167 | 168 | semicolon 0x33 169 | period 0x33 shift 170 | horizconnector 0x33 altgr 171 | multiply 0x33 shift altgr 172 | 173 | colon 0x34 174 | slash 0x34 shift 175 | periodcentered 0x34 altgr 176 | division 0x34 shift altgr 177 | 178 | exclam 0x35 179 | section 0x35 shift 180 | dead_belowdot 0x35 altgr 181 | dead_abovedot 0x35 shift altgr 182 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/fr-be: -------------------------------------------------------------------------------- 1 | # generated from XKB map be 2 | include common 3 | map 0x80c 4 | ampersand 0x02 5 | 1 0x02 shift 6 | bar 0x02 altgr 7 | exclamdown 0x02 shift altgr 8 | eacute 0x03 9 | 2 0x03 shift 10 | at 0x03 altgr 11 | oneeighth 0x03 shift altgr 12 | quotedbl 0x04 13 | 3 0x04 shift 14 | numbersign 0x04 altgr 15 | sterling 0x04 shift altgr 16 | apostrophe 0x05 17 | 4 0x05 shift 18 | onequarter 0x05 altgr 19 | dollar 0x05 shift altgr 20 | parenleft 0x06 21 | 5 0x06 shift 22 | onehalf 0x06 altgr 23 | threeeighths 0x06 shift altgr 24 | section 0x07 25 | 6 0x07 shift 26 | asciicircum 0x07 altgr 27 | fiveeighths 0x07 shift altgr 28 | egrave 0x08 29 | 7 0x08 shift 30 | braceleft 0x08 altgr 31 | seveneighths 0x08 shift altgr 32 | exclam 0x09 33 | 8 0x09 shift 34 | bracketleft 0x09 altgr 35 | trademark 0x09 shift altgr 36 | ccedilla 0x0a 37 | 9 0x0a shift 38 | braceleft 0x0a altgr 39 | plusminus 0x0a shift altgr 40 | agrave 0x0b 41 | 0 0x0b shift 42 | braceright 0x0b altgr 43 | degree 0x0b shift altgr 44 | parenright 0x0c 45 | degree 0x0c shift 46 | backslash 0x0c altgr 47 | questiondown 0x0c shift altgr 48 | minus 0x0d 49 | underscore 0x0d shift 50 | dead_cedilla 0x0d altgr 51 | dead_ogonek 0x0d shift altgr 52 | a 0x10 addupper 53 | Greek_OMEGA 0x10 shift altgr 54 | z 0x11 addupper 55 | lstroke 0x11 altgr 56 | Lstroke 0x11 shift altgr 57 | EuroSign 0x12 altgr 58 | cent 0x12 shift altgr 59 | paragraph 0x13 altgr 60 | registered 0x13 shift altgr 61 | tslash 0x14 altgr 62 | Tslash 0x14 shift altgr 63 | leftarrow 0x15 altgr 64 | yen 0x15 shift altgr 65 | downarrow 0x16 altgr 66 | uparrow 0x16 shift altgr 67 | rightarrow 0x17 altgr 68 | idotless 0x17 shift altgr 69 | oslash 0x18 altgr 70 | Ooblique 0x18 shift altgr 71 | thorn 0x19 altgr 72 | THORN 0x19 shift altgr 73 | dead_circumflex 0x1a 74 | dead_diaeresis 0x1a shift 75 | bracketleft 0x1a altgr 76 | dead_abovering 0x1a shift altgr 77 | dollar 0x1b 78 | asterisk 0x1b shift 79 | bracketright 0x1b altgr 80 | dead_macron 0x1b shift altgr 81 | q 0x1e addupper 82 | ae 0x1e altgr 83 | AE 0x1e shift altgr 84 | ssharp 0x1f altgr 85 | eth 0x20 altgr 86 | ETH 0x20 shift altgr 87 | dstroke 0x21 altgr 88 | ordfeminine 0x21 shift altgr 89 | eng 0x22 altgr 90 | ENG 0x22 shift altgr 91 | hstroke 0x23 altgr 92 | Hstroke 0x23 shift altgr 93 | kra 0x25 altgr 94 | lstroke 0x26 altgr 95 | Lstroke 0x26 shift altgr 96 | m 0x27 addupper 97 | dead_acute 0x27 altgr 98 | dead_doubleacute 0x27 shift altgr 99 | ugrave 0x28 100 | percent 0x28 shift 101 | dead_acute 0x28 altgr 102 | dead_caron 0x28 shift altgr 103 | twosuperior 0x29 104 | threesuperior 0x29 shift 105 | notsign 0x29 altgr 106 | mu 0x2b 107 | sterling 0x2b shift 108 | dead_grave 0x2b altgr 109 | dead_breve 0x2b shift altgr 110 | w 0x2c addupper 111 | guillemotleft 0x2c altgr 112 | guillemotright 0x2d altgr 113 | cent 0x2e altgr 114 | copyright 0x2e shift altgr 115 | leftdoublequotemark 0x2f altgr 116 | grave 0x2f shift altgr 117 | rightdoublequotemark 0x30 altgr 118 | comma 0x32 119 | question 0x32 shift 120 | dead_cedilla 0x32 altgr 121 | masculine 0x32 shift altgr 122 | semicolon 0x33 123 | period 0x33 shift 124 | horizconnector 0x33 altgr 125 | multiply 0x33 shift altgr 126 | colon 0x34 127 | slash 0x34 shift 128 | periodcentered 0x34 altgr 129 | division 0x34 shift altgr 130 | equal 0x35 131 | plus 0x35 shift 132 | dead_tilde 0x35 altgr 133 | dead_abovedot 0x35 shift altgr 134 | backslash 0x56 altgr 135 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/fr-ca: -------------------------------------------------------------------------------- 1 | # Canadian French 2 | # By Simon Germain 3 | include common 4 | map 0xc0c 5 | 6 | backslash 0x29 altgr 7 | plusminus 0x2 altgr 8 | at 0x3 altgr 9 | sterling 0x4 altgr 10 | cent 0x5 altgr 11 | currency 0x6 altgr 12 | notsign 0x7 altgr 13 | bar 0x29 shift 14 | twosuperior 0x9 altgr 15 | threesuperior 0xa altgr 16 | onequarter 0xb altgr 17 | onehalf 0xc altgr 18 | threequarters 0xd altgr 19 | section 0x18 altgr 20 | paragraph 0x19 altgr 21 | bracketleft 0x1a altgr 22 | bracketright 0x1b altgr 23 | asciitilde 0x27 altgr 24 | braceleft 0x28 altgr 25 | braceright 0x2b altgr 26 | less 0x2b 27 | greater 0x2b shift 28 | guillemotleft 0x56 29 | guillemotright 0x56 shift 30 | degree 0x56 altgr 31 | mu 0x32 altgr 32 | eacute 0x35 33 | dead_acute 0x35 altgr 34 | dead_grave 0x28 35 | dead_circumflex 0x1a 36 | dead_circumflex 0x1a shift 37 | dead_cedilla 0x1b 38 | dead_diaeresis 0x1b shift 39 | exclam 0x2 shift 40 | quotedbl 0x3 shift 41 | slash 0x4 shift 42 | dollar 0x5 shift 43 | percent 0x6 shift 44 | question 0x7 shift 45 | ampersand 0x8 shift 46 | asterisk 0x9 shift 47 | parenleft 0xa shift 48 | parenright 0xb shift 49 | underscore 0xc shift 50 | plus 0xd shift 51 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/fr-ch: -------------------------------------------------------------------------------- 1 | # generated from XKB map fr_CH 2 | include common 3 | map 0x100c 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | twosuperior 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | section 0x04 shift 11 | threesuperior 0x04 altgr 12 | sterling 0x04 shift altgr 13 | dollar 0x05 shift 14 | onequarter 0x05 altgr 15 | currency 0x05 shift altgr 16 | percent 0x06 shift 17 | onehalf 0x06 altgr 18 | threeeighths 0x06 shift altgr 19 | ampersand 0x07 shift 20 | threequarters 0x07 altgr 21 | fiveeighths 0x07 shift altgr 22 | slash 0x08 shift 23 | braceleft 0x08 altgr 24 | seveneighths 0x08 shift altgr 25 | parenleft 0x09 shift 26 | bracketleft 0x09 altgr 27 | trademark 0x09 shift altgr 28 | parenright 0x0a shift 29 | bracketright 0x0a altgr 30 | plusminus 0x0a shift altgr 31 | equal 0x0b shift 32 | braceright 0x0b altgr 33 | ssharp 0x0c 34 | question 0x0c shift 35 | backslash 0x0c altgr 36 | questiondown 0x0c shift altgr 37 | acute 0x0d 38 | dead_acute 0x0d 39 | grave 0x0d shift 40 | dead_grave 0x0d shift 41 | dead_cedilla 0x0d altgr 42 | dead_ogonek 0x0d shift altgr 43 | at 0x10 altgr 44 | Greek_OMEGA 0x10 shift altgr 45 | EuroSign 0x12 altgr 46 | paragraph 0x13 altgr 47 | registered 0x13 shift altgr 48 | tslash 0x14 altgr 49 | Tslash 0x14 shift altgr 50 | z 0x15 addupper 51 | leftarrow 0x15 altgr 52 | yen 0x15 shift altgr 53 | downarrow 0x16 altgr 54 | uparrow 0x16 shift altgr 55 | rightarrow 0x17 altgr 56 | idotless 0x17 shift altgr 57 | oslash 0x18 altgr 58 | Ooblique 0x18 shift altgr 59 | thorn 0x19 altgr 60 | THORN 0x19 shift altgr 61 | udiaeresis 0x1a 62 | Udiaeresis 0x1a shift 63 | dead_diaeresis 0x1a altgr 64 | dead_abovering 0x1a shift altgr 65 | plus 0x1b 66 | asterisk 0x1b shift 67 | asciitilde 0x1b altgr 68 | dead_tilde 0x1b altgr 69 | dead_macron 0x1b shift altgr 70 | ae 0x1e altgr 71 | AE 0x1e shift altgr 72 | eth 0x20 altgr 73 | ETH 0x20 shift altgr 74 | dstroke 0x21 altgr 75 | ordfeminine 0x21 shift altgr 76 | eng 0x22 altgr 77 | ENG 0x22 shift altgr 78 | hstroke 0x23 altgr 79 | Hstroke 0x23 shift altgr 80 | kra 0x25 altgr 81 | odiaeresis 0x27 82 | Odiaeresis 0x27 shift 83 | dead_doubleacute 0x27 altgr 84 | adiaeresis 0x28 85 | Adiaeresis 0x28 shift 86 | dead_caron 0x28 shift altgr 87 | asciicircum 0x29 88 | dead_circumflex 0x29 89 | degree 0x29 shift 90 | notsign 0x29 altgr 91 | numbersign 0x2b 92 | apostrophe 0x2b shift 93 | dead_breve 0x2b shift altgr 94 | y 0x2c addupper 95 | guillemotleft 0x2c altgr 96 | guillemotright 0x2d altgr 97 | cent 0x2e altgr 98 | copyright 0x2e shift altgr 99 | leftdoublequotemark 0x2f altgr 100 | rightdoublequotemark 0x30 altgr 101 | mu 0x32 altgr 102 | masculine 0x32 shift altgr 103 | comma 0x33 104 | semicolon 0x33 shift 105 | horizconnector 0x33 altgr 106 | multiply 0x33 shift altgr 107 | period 0x34 108 | colon 0x34 shift 109 | periodcentered 0x34 altgr 110 | division 0x34 shift altgr 111 | minus 0x35 112 | underscore 0x35 shift 113 | dead_belowdot 0x35 altgr 114 | dead_abovedot 0x35 shift altgr 115 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/hr: -------------------------------------------------------------------------------- 1 | # generated from XKB map hr 2 | include common 3 | map 0x41a 4 | exclam 0x02 shift 5 | asciitilde 0x02 altgr 6 | dead_tilde 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | dead_caron 0x03 altgr 9 | caron 0x03 shift altgr 10 | numbersign 0x04 shift 11 | asciicircum 0x04 altgr 12 | dead_circumflex 0x04 shift altgr 13 | dollar 0x05 shift 14 | dead_breve 0x05 altgr 15 | breve 0x05 shift altgr 16 | percent 0x06 shift 17 | degree 0x06 altgr 18 | dead_abovering 0x06 shift altgr 19 | ampersand 0x07 shift 20 | dead_ogonek 0x07 altgr 21 | ogonek 0x07 shift altgr 22 | slash 0x08 shift 23 | grave 0x08 altgr 24 | dead_grave 0x08 shift altgr 25 | parenleft 0x09 shift 26 | dead_abovedot 0x09 altgr 27 | abovedot 0x09 shift altgr 28 | parenright 0x0a shift 29 | dead_acute 0x0a altgr 30 | apostrophe 0x0a shift altgr 31 | equal 0x0b shift 32 | dead_doubleacute 0x0b altgr 33 | doubleacute 0x0b shift altgr 34 | apostrophe 0x0c 35 | question 0x0c shift 36 | dead_diaeresis 0x0c altgr 37 | diaeresis 0x0c shift altgr 38 | plus 0x0d 39 | asterisk 0x0d shift 40 | dead_cedilla 0x0d altgr 41 | cedilla 0x0d shift altgr 42 | backslash 0x10 altgr 43 | Greek_OMEGA 0x10 shift altgr 44 | bar 0x11 altgr 45 | Lstroke 0x11 shift altgr 46 | EuroSign 0x12 altgr 47 | paragraph 0x13 altgr 48 | registered 0x13 shift altgr 49 | tslash 0x14 altgr 50 | Tslash 0x14 shift altgr 51 | z 0x15 addupper 52 | leftarrow 0x15 altgr 53 | yen 0x15 shift altgr 54 | downarrow 0x16 altgr 55 | uparrow 0x16 shift altgr 56 | rightarrow 0x17 altgr 57 | idotless 0x17 shift altgr 58 | oslash 0x18 altgr 59 | Ooblique 0x18 shift altgr 60 | thorn 0x19 altgr 61 | THORN 0x19 shift altgr 62 | scaron 0x1a 63 | Scaron 0x1a shift 64 | division 0x1a altgr 65 | dead_abovering 0x1a shift altgr 66 | dstroke 0x1b 67 | Dstroke 0x1b shift 68 | multiply 0x1b altgr 69 | dead_macron 0x1b shift altgr 70 | ae 0x1e altgr 71 | AE 0x1e shift altgr 72 | ssharp 0x1f altgr 73 | section 0x1f shift altgr 74 | eth 0x20 altgr 75 | ETH 0x20 shift altgr 76 | bracketleft 0x21 altgr 77 | ordfeminine 0x21 shift altgr 78 | bracketright 0x22 altgr 79 | ENG 0x22 shift altgr 80 | hstroke 0x23 altgr 81 | Hstroke 0x23 shift altgr 82 | lstroke 0x25 altgr 83 | ampersand 0x25 shift altgr 84 | Lstroke 0x26 altgr 85 | ccaron 0x27 86 | Ccaron 0x27 shift 87 | dead_acute 0x27 altgr 88 | dead_doubleacute 0x27 shift altgr 89 | cacute 0x28 90 | Cacute 0x28 shift 91 | ssharp 0x28 altgr 92 | dead_caron 0x28 shift altgr 93 | dead_cedilla 0x29 94 | dead_diaeresis 0x29 shift 95 | notsign 0x29 altgr 96 | zcaron 0x2b 97 | Zcaron 0x2b shift 98 | currency 0x2b altgr 99 | dead_breve 0x2b shift altgr 100 | y 0x2c addupper 101 | guillemotleft 0x2c altgr 102 | less 0x2c shift altgr 103 | guillemotright 0x2d altgr 104 | greater 0x2d shift altgr 105 | cent 0x2e altgr 106 | copyright 0x2e shift altgr 107 | at 0x2f altgr 108 | grave 0x2f shift altgr 109 | braceleft 0x30 altgr 110 | apostrophe 0x30 shift altgr 111 | braceright 0x31 altgr 112 | section 0x32 altgr 113 | masculine 0x32 shift altgr 114 | comma 0x33 115 | semicolon 0x33 shift 116 | horizconnector 0x33 altgr 117 | multiply 0x33 shift altgr 118 | period 0x34 119 | colon 0x34 shift 120 | periodcentered 0x34 altgr 121 | division 0x34 shift altgr 122 | minus 0x35 123 | underscore 0x35 shift 124 | dead_belowdot 0x35 altgr 125 | dead_abovedot 0x35 shift altgr 126 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/hu: -------------------------------------------------------------------------------- 1 | # Hungarian keyboard layout (QWERTZ) 2 | # Created by: The NeverGone 3 | 4 | include common 5 | map 0x40e 6 | 7 | 8 | # AltGr keys: 9 | notsign 0x29 altgr 10 | asciitilde 0x02 altgr 11 | caron 0x03 altgr 12 | asciicircum 0x04 altgr 13 | breve 0x05 altgr 14 | degree 0x06 altgr 15 | ogonek 0x07 altgr 16 | grave 0x08 altgr 17 | abovedot 0x09 altgr 18 | acute 0x0a altgr 19 | doubleacute 0x0b altgr 20 | diaeresis 0x0c altgr 21 | cedilla 0x0d altgr 22 | backslash 0x10 altgr 23 | bar 0x11 altgr 24 | EuroSign 0x12 altgr 25 | Iacute 0x17 altgr 26 | division 0x1a altgr 27 | multiply 0x1b altgr 28 | dstroke 0x1f altgr 29 | Dstroke 0x20 altgr 30 | bracketleft 0x21 altgr 31 | bracketright 0x22 altgr 32 | iacute 0x24 altgr 33 | lstroke 0x25 altgr 34 | Lstroke 0x26 altgr 35 | dollar 0x27 altgr 36 | ssharp 0x28 altgr 37 | currency 0x2b altgr 38 | less 0x56 altgr 39 | greater 0x2c altgr 40 | numbersign 0x2d altgr 41 | ampersand 0x2e altgr 42 | at 0x2f altgr 43 | braceleft 0x30 altgr 44 | braceright 0x31 altgr 45 | semicolon 0x33 altgr 46 | asterisk 0x35 altgr 47 | 48 | 49 | # Shift keys: 50 | section 0x29 shift 51 | apostrophe 0x02 shift 52 | quotedbl 0x03 shift 53 | plus 0x04 shift 54 | exclam 0x05 shift 55 | percent 0x06 shift 56 | slash 0x07 shift 57 | equal 0x08 shift 58 | parenleft 0x09 shift 59 | parenright 0x0a shift 60 | Odiaeresis 0x0b shift 61 | Udiaeresis 0x0c shift 62 | Oacute 0x0d shift 63 | Z 0x15 shift 64 | Odoubleacute 0x1a shift 65 | Uacute 0x1b shift 66 | Eacute 0x27 shift 67 | Aacute 0x28 shift 68 | Udoubleacute 0x2b shift 69 | Y 0x2c shift 70 | question 0x33 shift 71 | colon 0x34 shift 72 | underscore 0x35 shift 73 | F13 0x3b shift 74 | F14 0x3c shift 75 | F15 0x3d shift 76 | F16 0x3e shift 77 | F17 0x3f shift 78 | F18 0x40 shift 79 | F19 0x41 shift 80 | F20 0x42 shift 81 | F21 0x43 shift 82 | F22 0x44 shift 83 | F23 0x57 shift 84 | F24 0x58 shift 85 | 86 | 87 | # Ctrl keys: 88 | F25 0x3b ctrl 89 | F26 0x3c ctrl 90 | F27 0x3d ctrl 91 | F28 0x3e ctrl 92 | F29 0x3f ctrl 93 | F30 0x40 ctrl 94 | F31 0x41 ctrl 95 | F32 0x42 ctrl 96 | F33 0x43 ctrl 97 | F34 0x44 ctrl 98 | F35 0x57 ctrl 99 | #NoSymbol 0x58 ctrl 100 | 101 | 102 | 0 0x29 103 | odiaeresis 0x0b 104 | udiaeresis 0x0c 105 | oacute 0x0d 106 | z 0x15 107 | odoubleacute 0x1a 108 | uacute 0x1b 109 | eacute 0x27 110 | aacute 0x28 111 | udoubleacute 0x2b 112 | y 0x2c 113 | comma 0x33 114 | period 0x34 115 | minus 0x35 116 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/is: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/keymaps/is -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/it: -------------------------------------------------------------------------------- 1 | # generated from XKB map it 2 | include common 3 | map 0x410 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | twosuperior 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | sterling 0x04 shift 11 | threesuperior 0x04 altgr 12 | dollar 0x05 shift 13 | onequarter 0x05 altgr 14 | percent 0x06 shift 15 | onehalf 0x06 altgr 16 | threeeighths 0x06 shift altgr 17 | ampersand 0x07 shift 18 | threequarters 0x07 altgr 19 | fiveeighths 0x07 shift altgr 20 | slash 0x08 shift 21 | braceleft 0x08 altgr 22 | seveneighths 0x08 shift altgr 23 | parenleft 0x09 shift 24 | trademark 0x09 shift altgr 25 | parenright 0x0a shift 26 | plusminus 0x0a shift altgr 27 | equal 0x0b shift 28 | braceright 0x0b altgr 29 | degree 0x0b shift altgr 30 | apostrophe 0x0c 31 | question 0x0c shift 32 | grave 0x0c altgr 33 | questiondown 0x0c shift altgr 34 | igrave 0x0d 35 | asciicircum 0x0d shift 36 | asciitilde 0x0d altgr 37 | dead_ogonek 0x0d shift altgr 38 | at 0x10 altgr 39 | Greek_OMEGA 0x10 shift altgr 40 | lstroke 0x11 altgr 41 | Lstroke 0x11 shift altgr 42 | EuroSign 0x12 altgr 43 | cent 0x12 shift altgr 44 | paragraph 0x13 altgr 45 | registered 0x13 shift altgr 46 | tslash 0x14 altgr 47 | Tslash 0x14 shift altgr 48 | leftarrow 0x15 altgr 49 | yen 0x15 shift altgr 50 | downarrow 0x16 altgr 51 | uparrow 0x16 shift altgr 52 | rightarrow 0x17 altgr 53 | idotless 0x17 shift altgr 54 | oslash 0x18 altgr 55 | Ooblique 0x18 shift altgr 56 | thorn 0x19 altgr 57 | THORN 0x19 shift altgr 58 | egrave 0x1a 59 | eacute 0x1a shift 60 | bracketleft 0x1a altgr 61 | dead_abovering 0x1a shift altgr 62 | plus 0x1b 63 | asterisk 0x1b shift 64 | bracketright 0x1b altgr 65 | dead_macron 0x1b shift altgr 66 | ae 0x1e altgr 67 | AE 0x1e shift altgr 68 | ssharp 0x1f altgr 69 | section 0x1f shift altgr 70 | eth 0x20 altgr 71 | ETH 0x20 shift altgr 72 | dstroke 0x21 altgr 73 | ordfeminine 0x21 shift altgr 74 | eng 0x22 altgr 75 | ENG 0x22 shift altgr 76 | hstroke 0x23 altgr 77 | Hstroke 0x23 shift altgr 78 | kra 0x25 altgr 79 | lstroke 0x26 altgr 80 | Lstroke 0x26 shift altgr 81 | ograve 0x27 82 | ccedilla 0x27 shift 83 | at 0x27 altgr 84 | dead_doubleacute 0x27 shift altgr 85 | agrave 0x28 86 | degree 0x28 shift 87 | numbersign 0x28 altgr 88 | backslash 0x29 89 | bar 0x29 shift 90 | notsign 0x29 altgr 91 | ugrave 0x2b 92 | section 0x2b shift 93 | dead_grave 0x2b altgr 94 | dead_breve 0x2b shift altgr 95 | guillemotleft 0x2c altgr 96 | guillemotright 0x2d altgr 97 | cent 0x2e altgr 98 | copyright 0x2e shift altgr 99 | leftdoublequotemark 0x2f altgr 100 | grave 0x2f shift altgr 101 | rightdoublequotemark 0x30 altgr 102 | mu 0x32 altgr 103 | masculine 0x32 shift altgr 104 | comma 0x33 105 | semicolon 0x33 shift 106 | horizconnector 0x33 altgr 107 | multiply 0x33 shift altgr 108 | period 0x34 109 | colon 0x34 shift 110 | periodcentered 0x34 altgr 111 | division 0x34 shift altgr 112 | minus 0x35 113 | underscore 0x35 shift 114 | dead_belowdot 0x35 altgr 115 | dead_abovedot 0x35 shift altgr 116 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/ja: -------------------------------------------------------------------------------- 1 | # generated from XKB map jp106 2 | include common 3 | map 0x411 4 | exclam 0x02 shift 5 | kana_NU 0x02 altgr 6 | quotedbl 0x03 shift 7 | kana_FU 0x03 altgr 8 | numbersign 0x04 shift 9 | kana_A 0x04 altgr 10 | kana_a 0x04 shift altgr 11 | dollar 0x05 shift 12 | kana_U 0x05 altgr 13 | kana_u 0x05 shift altgr 14 | percent 0x06 shift 15 | kana_E 0x06 altgr 16 | kana_e 0x06 shift altgr 17 | ampersand 0x07 shift 18 | kana_O 0x07 altgr 19 | kana_o 0x07 shift altgr 20 | apostrophe 0x08 shift 21 | kana_YA 0x08 altgr 22 | kana_ya 0x08 shift altgr 23 | parenleft 0x09 shift 24 | kana_YU 0x09 altgr 25 | kana_yu 0x09 shift altgr 26 | parenright 0x0a shift 27 | kana_YO 0x0a altgr 28 | kana_yo 0x0a shift altgr 29 | asciitilde 0x0b shift 30 | kana_WA 0x0b altgr 31 | kana_WO 0x0b shift altgr 32 | minus 0x0c 33 | equal 0x0c shift 34 | kana_HO 0x0c altgr 35 | asciicircum 0x0d 36 | asciitilde 0x0d shift 37 | kana_HE 0x0d altgr 38 | kana_TA 0x10 altgr 39 | kana_TE 0x11 altgr 40 | kana_I 0x12 altgr 41 | kana_i 0x12 shift altgr 42 | kana_SU 0x13 altgr 43 | kana_KA 0x14 altgr 44 | kana_N 0x15 altgr 45 | kana_NA 0x16 altgr 46 | kana_NI 0x17 altgr 47 | kana_RA 0x18 altgr 48 | kana_SE 0x19 altgr 49 | at 0x1a 50 | grave 0x1a shift 51 | voicedsound 0x1a altgr 52 | bracketleft 0x1b 53 | braceleft 0x1b shift 54 | semivoicedsound 0x1b altgr 55 | kana_openingbracket 0x1b shift altgr 56 | kana_CHI 0x1e altgr 57 | kana_TO 0x1f altgr 58 | kana_SHI 0x20 altgr 59 | kana_HA 0x21 altgr 60 | kana_KI 0x22 altgr 61 | kana_KU 0x23 altgr 62 | kana_MA 0x24 altgr 63 | kana_NO 0x25 altgr 64 | kana_RI 0x26 altgr 65 | semicolon 0x27 66 | plus 0x27 shift 67 | kana_RE 0x27 altgr 68 | colon 0x28 69 | asterisk 0x28 shift 70 | kana_KE 0x28 altgr 71 | Zenkaku_Hankaku 0x29 72 | bracketright 0x2b 73 | braceright 0x2b shift 74 | kana_MU 0x2b altgr 75 | kana_closingbracket 0x2b shift altgr 76 | kana_TSU 0x2c altgr 77 | kana_tsu 0x2c shift altgr 78 | kana_SA 0x2d altgr 79 | kana_SO 0x2e altgr 80 | kana_HI 0x2f altgr 81 | kana_KO 0x30 altgr 82 | kana_MI 0x31 altgr 83 | kana_MO 0x32 altgr 84 | comma 0x33 85 | less 0x33 shift 86 | kana_NE 0x33 altgr 87 | kana_comma 0x33 shift altgr 88 | period 0x34 89 | greater 0x34 shift 90 | kana_RU 0x34 altgr 91 | kana_fullstop 0x34 shift altgr 92 | slash 0x35 93 | question 0x35 shift 94 | kana_ME 0x35 altgr 95 | kana_conjunctive 0x35 shift altgr 96 | Eisu_toggle 0x3a shift 97 | Execute 0x54 shift 98 | Kanji 0x70 99 | backslash 0x73 100 | yen 0x7d 101 | bar 0x7d shift 102 | underscore 0x73 shift 103 | Henkan_Mode 0x79 104 | Katakana_Real 0x70 105 | Katakana 0x70 106 | Muhenkan 0x7b 107 | Henkan_Mode_Real 0x79 108 | Henkan_Mode_Ultra 0x79 109 | backslash_ja 0x73 110 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/lt: -------------------------------------------------------------------------------- 1 | # generated from XKB map lt 2 | include common 3 | map 0x427 4 | exclam 0x02 shift 5 | aogonek 0x02 altgr 6 | Aogonek 0x02 shift altgr 7 | at 0x03 shift 8 | ccaron 0x03 altgr 9 | Ccaron 0x03 shift altgr 10 | numbersign 0x04 shift 11 | eogonek 0x04 altgr 12 | Eogonek 0x04 shift altgr 13 | dollar 0x05 shift 14 | eabovedot 0x05 altgr 15 | Eabovedot 0x05 shift altgr 16 | percent 0x06 shift 17 | iogonek 0x06 altgr 18 | Iogonek 0x06 shift altgr 19 | asciicircum 0x07 shift 20 | scaron 0x07 altgr 21 | Scaron 0x07 shift altgr 22 | ampersand 0x08 shift 23 | uogonek 0x08 altgr 24 | Uogonek 0x08 shift altgr 25 | asterisk 0x09 shift 26 | umacron 0x09 altgr 27 | Umacron 0x09 shift altgr 28 | parenleft 0x0a shift 29 | doublelowquotemark 0x0a altgr 30 | parenright 0x0b shift 31 | leftdoublequotemark 0x0b altgr 32 | minus 0x0c 33 | underscore 0x0c shift 34 | equal 0x0d 35 | plus 0x0d shift 36 | zcaron 0x0d altgr 37 | Zcaron 0x0d shift altgr 38 | bracketleft 0x1a 39 | braceleft 0x1a shift 40 | bracketright 0x1b 41 | braceright 0x1b shift 42 | semicolon 0x27 43 | colon 0x27 shift 44 | apostrophe 0x28 45 | quotedbl 0x28 shift 46 | grave 0x29 47 | asciitilde 0x29 shift 48 | backslash 0x2b 49 | bar 0x2b shift 50 | comma 0x33 51 | less 0x33 shift 52 | period 0x34 53 | greater 0x34 shift 54 | slash 0x35 55 | question 0x35 shift 56 | endash 0x56 57 | EuroSign 0x56 shift 58 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/lv: -------------------------------------------------------------------------------- 1 | # generated from XKB map lv 2 | include common 3 | map 0x426 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | at 0x03 shift 8 | twosuperior 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | numbersign 0x04 shift 11 | threesuperior 0x04 altgr 12 | sterling 0x04 shift altgr 13 | dollar 0x05 shift 14 | EuroSign 0x05 altgr 15 | cent 0x05 shift altgr 16 | percent 0x06 shift 17 | onehalf 0x06 altgr 18 | threeeighths 0x06 shift altgr 19 | asciicircum 0x07 shift 20 | threequarters 0x07 altgr 21 | fiveeighths 0x07 shift altgr 22 | ampersand 0x08 shift 23 | braceleft 0x08 altgr 24 | seveneighths 0x08 shift altgr 25 | asterisk 0x09 shift 26 | bracketleft 0x09 altgr 27 | trademark 0x09 shift altgr 28 | parenleft 0x0a shift 29 | bracketright 0x0a altgr 30 | plusminus 0x0a shift altgr 31 | parenright 0x0b shift 32 | braceright 0x0b altgr 33 | degree 0x0b shift altgr 34 | minus 0x0c 35 | underscore 0x0c shift 36 | backslash 0x0c altgr 37 | questiondown 0x0c shift altgr 38 | equal 0x0d 39 | plus 0x0d shift 40 | dead_cedilla 0x0d altgr 41 | dead_ogonek 0x0d shift altgr 42 | at 0x10 altgr 43 | Greek_OMEGA 0x10 shift altgr 44 | lstroke 0x11 altgr 45 | Lstroke 0x11 shift altgr 46 | emacron 0x12 altgr 47 | Emacron 0x12 shift altgr 48 | rcedilla 0x13 altgr 49 | Rcedilla 0x13 shift altgr 50 | tslash 0x14 altgr 51 | Tslash 0x14 shift altgr 52 | leftarrow 0x15 altgr 53 | yen 0x15 shift altgr 54 | umacron 0x16 altgr 55 | Umacron 0x16 shift altgr 56 | imacron 0x17 altgr 57 | Imacron 0x17 shift altgr 58 | omacron 0x18 altgr 59 | Omacron 0x18 shift altgr 60 | thorn 0x19 altgr 61 | THORN 0x19 shift altgr 62 | bracketleft 0x1a 63 | braceleft 0x1a shift 64 | dead_diaeresis 0x1a altgr 65 | dead_abovering 0x1a shift altgr 66 | bracketright 0x1b 67 | braceright 0x1b shift 68 | dead_tilde 0x1b altgr 69 | dead_macron 0x1b shift altgr 70 | ISO_Next_Group 0x1c shift 71 | amacron 0x1e altgr 72 | Amacron 0x1e shift altgr 73 | scaron 0x1f altgr 74 | Scaron 0x1f shift altgr 75 | eth 0x20 altgr 76 | ETH 0x20 shift altgr 77 | dstroke 0x21 altgr 78 | ordfeminine 0x21 shift altgr 79 | gcedilla 0x22 altgr 80 | Gcedilla 0x22 shift altgr 81 | hstroke 0x23 altgr 82 | Hstroke 0x23 shift altgr 83 | kcedilla 0x25 altgr 84 | Kcedilla 0x25 shift altgr 85 | lcedilla 0x26 altgr 86 | Lcedilla 0x26 shift altgr 87 | semicolon 0x27 88 | colon 0x27 shift 89 | dead_acute 0x27 altgr 90 | dead_doubleacute 0x27 shift altgr 91 | apostrophe 0x28 92 | quotedbl 0x28 shift 93 | leftdoublequotemark 0x28 altgr 94 | doublelowquotemark 0x28 shift altgr 95 | grave 0x29 96 | asciitilde 0x29 shift 97 | notsign 0x29 altgr 98 | backslash 0x2b 99 | bar 0x2b shift 100 | dead_grave 0x2b altgr 101 | dead_breve 0x2b shift altgr 102 | zcaron 0x2c altgr 103 | Zcaron 0x2c shift altgr 104 | guillemotright 0x2d altgr 105 | greater 0x2d shift altgr 106 | ccaron 0x2e altgr 107 | Ccaron 0x2e shift altgr 108 | leftdoublequotemark 0x2f altgr 109 | grave 0x2f shift altgr 110 | rightdoublequotemark 0x30 altgr 111 | apostrophe 0x30 shift altgr 112 | ncedilla 0x31 altgr 113 | Ncedilla 0x31 shift altgr 114 | mu 0x32 altgr 115 | masculine 0x32 shift altgr 116 | comma 0x33 117 | less 0x33 shift 118 | horizconnector 0x33 altgr 119 | multiply 0x33 shift altgr 120 | period 0x34 121 | greater 0x34 shift 122 | periodcentered 0x34 altgr 123 | division 0x34 shift altgr 124 | slash 0x35 125 | question 0x35 shift 126 | dead_belowdot 0x35 altgr 127 | dead_abovedot 0x35 shift altgr 128 | nobreakspace 0x39 altgr 129 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/mk: -------------------------------------------------------------------------------- 1 | # generated from XKB map mk 2 | include common 3 | map 0x42f 4 | exclam 0x02 shift 5 | at 0x03 shift 6 | doublelowquotemark 0x03 shift altgr 7 | numbersign 0x04 shift 8 | leftdoublequotemark 0x04 shift altgr 9 | dollar 0x05 shift 10 | percent 0x06 shift 11 | asciicircum 0x07 shift 12 | ampersand 0x08 shift 13 | asterisk 0x09 shift 14 | parenleft 0x0a shift 15 | parenright 0x0b shift 16 | minus 0x0c 17 | underscore 0x0c shift 18 | equal 0x0d 19 | plus 0x0d shift 20 | Cyrillic_lje 0x10 altgr 21 | Cyrillic_LJE 0x10 shift altgr 22 | Cyrillic_nje 0x11 altgr 23 | Cyrillic_NJE 0x11 shift altgr 24 | Cyrillic_ie 0x12 altgr 25 | Cyrillic_IE 0x12 shift altgr 26 | Cyrillic_er 0x13 altgr 27 | Cyrillic_ER 0x13 shift altgr 28 | Cyrillic_te 0x14 altgr 29 | Cyrillic_TE 0x14 shift altgr 30 | Macedonia_dse 0x15 altgr 31 | Macedonia_DSE 0x15 shift altgr 32 | Cyrillic_u 0x16 altgr 33 | Cyrillic_U 0x16 shift altgr 34 | Cyrillic_i 0x17 altgr 35 | Cyrillic_I 0x17 shift altgr 36 | Cyrillic_o 0x18 altgr 37 | Cyrillic_O 0x18 shift altgr 38 | Cyrillic_pe 0x19 altgr 39 | Cyrillic_PE 0x19 shift altgr 40 | bracketleft 0x1a 41 | braceleft 0x1a shift 42 | Cyrillic_sha 0x1a altgr 43 | Cyrillic_SHA 0x1a shift altgr 44 | bracketright 0x1b 45 | braceright 0x1b shift 46 | Macedonia_gje 0x1b altgr 47 | Macedonia_GJE 0x1b shift altgr 48 | Cyrillic_a 0x1e altgr 49 | Cyrillic_A 0x1e shift altgr 50 | Cyrillic_es 0x1f altgr 51 | Cyrillic_ES 0x1f shift altgr 52 | Cyrillic_de 0x20 altgr 53 | Cyrillic_DE 0x20 shift altgr 54 | Cyrillic_ef 0x21 altgr 55 | Cyrillic_EF 0x21 shift altgr 56 | Cyrillic_ghe 0x22 altgr 57 | Cyrillic_GHE 0x22 shift altgr 58 | Cyrillic_ha 0x23 altgr 59 | Cyrillic_HA 0x23 shift altgr 60 | Cyrillic_je 0x24 altgr 61 | Cyrillic_JE 0x24 shift altgr 62 | Cyrillic_ka 0x25 altgr 63 | Cyrillic_KA 0x25 shift altgr 64 | Cyrillic_el 0x26 altgr 65 | Cyrillic_EL 0x26 shift altgr 66 | semicolon 0x27 67 | colon 0x27 shift 68 | Cyrillic_che 0x27 altgr 69 | Cyrillic_CHE 0x27 shift altgr 70 | apostrophe 0x28 71 | quotedbl 0x28 shift 72 | Macedonia_kje 0x28 altgr 73 | Macedonia_KJE 0x28 shift altgr 74 | grave 0x29 75 | asciitilde 0x29 shift 76 | backslash 0x2b 77 | bar 0x2b shift 78 | Cyrillic_zhe 0x2b altgr 79 | Cyrillic_ZHE 0x2b shift altgr 80 | Cyrillic_ze 0x2c altgr 81 | Cyrillic_ZE 0x2c shift altgr 82 | Cyrillic_dzhe 0x2d altgr 83 | Cyrillic_DZHE 0x2d shift altgr 84 | Cyrillic_tse 0x2e altgr 85 | Cyrillic_TSE 0x2e shift altgr 86 | Cyrillic_ve 0x2f altgr 87 | Cyrillic_VE 0x2f shift altgr 88 | Cyrillic_be 0x30 altgr 89 | Cyrillic_BE 0x30 shift altgr 90 | Cyrillic_en 0x31 altgr 91 | Cyrillic_EN 0x31 shift altgr 92 | Cyrillic_em 0x32 altgr 93 | Cyrillic_EM 0x32 shift altgr 94 | comma 0x33 95 | less 0x33 shift 96 | semicolon 0x33 shift altgr 97 | period 0x34 98 | greater 0x34 shift 99 | colon 0x34 shift altgr 100 | slash 0x35 101 | question 0x35 shift 102 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/modifiers: -------------------------------------------------------------------------------- 1 | Shift_R 0x36 2 | Shift_L 0x2a 3 | 4 | Alt_R 0xb8 5 | Mode_switch 0xb8 6 | ISO_Level3_Shift 0xb8 7 | Alt_L 0x38 8 | 9 | Control_R 0x9d 10 | Control_L 0x1d 11 | 12 | # Translate Super to Windows keys. 13 | # This is hardcoded. See documentation for details. 14 | Super_R 0xdc 15 | Super_L 0xdb 16 | 17 | # Translate Menu to the Windows Application key. 18 | Menu 0xdd 19 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/nl: -------------------------------------------------------------------------------- 1 | # Dutch (Netherlands) 2 | include common 3 | map 0x413 4 | 5 | exclam 0x02 shift 6 | onesuperior 0x02 altgr 7 | quotebl 0x03 shift 8 | twosuperior 0x03 altgr 9 | numbersign 0x04 shift 10 | threesuperior 0x04 altgr 11 | dollar 0x05 shift 12 | onequarter 0x05 altgr 13 | percent 0x06 shift 14 | onehalf 0x06 altgr 15 | ampersand 0x07 shift 16 | threequarters 0x07 altgr 17 | underscore 0x08 shift 18 | sterling 0x08 altgr 19 | parenleft 0x09 shift 20 | braceleft 0x09 altgr 21 | parenright 0x0a shift 22 | braceright 0x0a altgr 23 | apostrophe 0x0b shift 24 | slash 0x0c 25 | question 0x0c shift 26 | backslash 0x0c altgr 27 | degree 0x0d 28 | dead_tilde 0x0d shift 29 | dead_cedilla 0x0d altgr 30 | EuroSign 0x12 altgr 31 | paragraph 0x13 altgr 32 | dead_diaeresis 0x1a 33 | dead_circumflex 0x1a shift 34 | asterisk 0x1b 35 | bar 0x1b shift 36 | ssharp 0x1f altgr 37 | plus 0x27 38 | plusminus 0x27 shift 39 | dead_acute 0x28 40 | dead_grave 0x28 shift 41 | at 0x29 42 | section 0x29 shift 43 | notsign 0x29 altgr 44 | less 0x2b 45 | greater 0x2b shift 46 | guillemotleft 0x2c altgr 47 | guillemotright 0x2d altgr 48 | copyright 0x2e altgr 49 | mu 0x32 altgr 50 | comma 0x33 51 | semicolon 0x33 shift 52 | period 0x34 53 | colon 0x34 shift 54 | periodcentered 0x34 altgr 55 | hyphen 0x35 56 | equal 0x35 shift 57 | bracketright 0x56 58 | bracketleft 0x56 shift 59 | brokenbar 0x56 altgr 60 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/nl-be: -------------------------------------------------------------------------------- 1 | # Dutch (Belgium) 2 | map 0x813 3 | include common 4 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/no: -------------------------------------------------------------------------------- 1 | # generated from XKB map no 2 | include common 3 | map 0x414 4 | exclam 0x02 shift 5 | exclamdown 0x02 altgr 6 | onesuperior 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | at 0x03 altgr 9 | twosuperior 0x03 shift altgr 10 | numbersign 0x04 shift 11 | sterling 0x04 altgr 12 | threesuperior 0x04 shift altgr 13 | currency 0x05 shift 14 | dollar 0x05 altgr 15 | onequarter 0x05 shift altgr 16 | percent 0x06 shift 17 | onehalf 0x06 altgr 18 | cent 0x06 shift altgr 19 | ampersand 0x07 shift 20 | yen 0x07 altgr 21 | fiveeighths 0x07 shift altgr 22 | slash 0x08 shift 23 | braceleft 0x08 altgr 24 | division 0x08 shift altgr 25 | parenleft 0x09 shift 26 | bracketleft 0x09 altgr 27 | guillemotleft 0x09 shift altgr 28 | parenright 0x0a shift 29 | bracketright 0x0a altgr 30 | guillemotright 0x0a shift altgr 31 | equal 0x0b shift 32 | braceright 0x0b altgr 33 | degree 0x0b shift altgr 34 | plus 0x0c 35 | question 0x0c shift 36 | plusminus 0x0c altgr 37 | questiondown 0x0c shift altgr 38 | backslash 0x0d 39 | dead_grave 0x0d shift 40 | dead_acute 0x0d altgr 41 | notsign 0x0d shift altgr 42 | Greek_OMEGA 0x10 shift altgr 43 | lstroke 0x11 altgr 44 | Lstroke 0x11 shift altgr 45 | EuroSign 0x12 altgr 46 | cent 0x12 shift altgr 47 | registered 0x13 altgr 48 | thorn 0x14 altgr 49 | THORN 0x14 shift altgr 50 | leftarrow 0x15 altgr 51 | yen 0x15 shift altgr 52 | downarrow 0x16 altgr 53 | uparrow 0x16 shift altgr 54 | rightarrow 0x17 altgr 55 | idotless 0x17 shift altgr 56 | oe 0x18 altgr 57 | OE 0x18 shift altgr 58 | thorn 0x19 altgr 59 | THORN 0x19 shift altgr 60 | aring 0x1a 61 | Aring 0x1a shift 62 | dead_diaeresis 0x1a altgr 63 | dead_abovering 0x1a shift altgr 64 | dead_diaeresis 0x1b 65 | dead_circumflex 0x1b shift 66 | asciicircum 0x01b shift 67 | dead_tilde 0x1b altgr 68 | asciitilde 0x1b altgr 69 | dead_caron 0x1b shift altgr 70 | ordfeminine 0x1e altgr 71 | masculine 0x1e shift altgr 72 | ssharp 0x1f altgr 73 | section 0x1f shift altgr 74 | eth 0x20 altgr 75 | ETH 0x20 shift altgr 76 | dstroke 0x21 altgr 77 | ordfeminine 0x21 shift altgr 78 | eng 0x22 altgr 79 | ENG 0x22 shift altgr 80 | hstroke 0x23 altgr 81 | Hstroke 0x23 shift altgr 82 | kra 0x25 altgr 83 | lstroke 0x26 altgr 84 | Lstroke 0x26 shift altgr 85 | oslash 0x27 86 | Ooblique 0x27 shift 87 | dead_doubleacute 0x27 shift altgr 88 | ae 0x28 89 | AE 0x28 shift 90 | dead_caron 0x28 shift altgr 91 | bar 0x29 92 | section 0x29 shift 93 | brokenbar 0x29 altgr 94 | paragraph 0x29 shift altgr 95 | apostrophe 0x2b 96 | asterisk 0x2b shift 97 | multiply 0x2b shift altgr 98 | guillemotleft 0x2c altgr 99 | guillemotright 0x2d altgr 100 | copyright 0x2e altgr 101 | leftdoublequotemark 0x2f altgr 102 | rightdoublequotemark 0x30 altgr 103 | mu 0x32 altgr 104 | masculine 0x32 shift altgr 105 | comma 0x33 106 | semicolon 0x33 shift 107 | dead_cedilla 0x33 altgr 108 | dead_ogonek 0x33 shift altgr 109 | period 0x34 110 | colon 0x34 shift 111 | periodcentered 0x34 altgr 112 | dead_abovedot 0x34 shift altgr 113 | minus 0x35 114 | underscore 0x35 shift 115 | hyphen 0x35 altgr 116 | macron 0x35 shift altgr 117 | nobreakspace 0x39 altgr 118 | onehalf 0x56 altgr 119 | threequarters 0x56 shift altgr 120 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/pl: -------------------------------------------------------------------------------- 1 | # generated from XKB map pl 2 | include common 3 | map 0x415 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | at 0x03 shift 8 | twosuperior 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | numbersign 0x04 shift 11 | threesuperior 0x04 altgr 12 | sterling 0x04 shift altgr 13 | dollar 0x05 shift 14 | onequarter 0x05 altgr 15 | percent 0x06 shift 16 | onehalf 0x06 altgr 17 | threeeighths 0x06 shift altgr 18 | asciicircum 0x07 shift 19 | threequarters 0x07 altgr 20 | fiveeighths 0x07 shift altgr 21 | ampersand 0x08 shift 22 | braceleft 0x08 altgr 23 | seveneighths 0x08 shift altgr 24 | asterisk 0x09 shift 25 | bracketleft 0x09 altgr 26 | trademark 0x09 shift altgr 27 | parenleft 0x0a shift 28 | bracketright 0x0a altgr 29 | plusminus 0x0a shift altgr 30 | parenright 0x0b shift 31 | braceright 0x0b altgr 32 | degree 0x0b shift altgr 33 | minus 0x0c 34 | underscore 0x0c shift 35 | backslash 0x0c altgr 36 | questiondown 0x0c shift altgr 37 | equal 0x0d 38 | plus 0x0d shift 39 | dead_cedilla 0x0d altgr 40 | dead_ogonek 0x0d shift altgr 41 | Greek_OMEGA 0x10 shift altgr 42 | lstroke 0x11 altgr 43 | Lstroke 0x11 shift altgr 44 | eogonek 0x12 altgr 45 | Eogonek 0x12 shift altgr 46 | paragraph 0x13 altgr 47 | registered 0x13 shift altgr 48 | tslash 0x14 altgr 49 | Tslash 0x14 shift altgr 50 | leftarrow 0x15 altgr 51 | yen 0x15 shift altgr 52 | EuroSign 0x16 altgr 53 | uparrow 0x16 shift altgr 54 | rightarrow 0x17 altgr 55 | idotless 0x17 shift altgr 56 | oacute 0x18 altgr 57 | Oacute 0x18 shift altgr 58 | thorn 0x19 altgr 59 | THORN 0x19 shift altgr 60 | bracketleft 0x1a 61 | braceleft 0x1a shift 62 | dead_diaeresis 0x1a altgr 63 | dead_abovering 0x1a shift altgr 64 | bracketright 0x1b 65 | braceright 0x1b shift 66 | dead_tilde 0x1b altgr 67 | dead_macron 0x1b shift altgr 68 | aogonek 0x1e altgr 69 | Aogonek 0x1e shift altgr 70 | sacute 0x1f altgr 71 | Sacute 0x1f shift altgr 72 | eth 0x20 altgr 73 | ETH 0x20 shift altgr 74 | dstroke 0x21 altgr 75 | ordfeminine 0x21 shift altgr 76 | eng 0x22 altgr 77 | ENG 0x22 shift altgr 78 | hstroke 0x23 altgr 79 | Hstroke 0x23 shift altgr 80 | kra 0x25 altgr 81 | lstroke 0x26 altgr 82 | Lstroke 0x26 shift altgr 83 | semicolon 0x27 84 | colon 0x27 shift 85 | dead_acute 0x27 altgr 86 | dead_doubleacute 0x27 shift altgr 87 | apostrophe 0x28 88 | quotedbl 0x28 shift 89 | dead_circumflex 0x28 altgr 90 | dead_caron 0x28 shift altgr 91 | grave 0x29 92 | asciitilde 0x29 shift 93 | notsign 0x29 altgr 94 | backslash 0x2b 95 | bar 0x2b shift 96 | dead_grave 0x2b altgr 97 | dead_breve 0x2b shift altgr 98 | zabovedot 0x2c altgr 99 | Zabovedot 0x2c shift altgr 100 | zacute 0x2d altgr 101 | Zacute 0x2d shift altgr 102 | cacute 0x2e altgr 103 | Cacute 0x2e shift altgr 104 | leftdoublequotemark 0x2f altgr 105 | grave 0x2f shift altgr 106 | rightdoublequotemark 0x30 altgr 107 | nacute 0x31 altgr 108 | Nacute 0x31 shift altgr 109 | mu 0x32 altgr 110 | masculine 0x32 shift altgr 111 | comma 0x33 112 | less 0x33 shift 113 | horizconnector 0x33 altgr 114 | multiply 0x33 shift altgr 115 | period 0x34 116 | greater 0x34 shift 117 | periodcentered 0x34 altgr 118 | division 0x34 shift altgr 119 | slash 0x35 120 | question 0x35 shift 121 | dead_belowdot 0x35 altgr 122 | dead_abovedot 0x35 shift altgr 123 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/pt: -------------------------------------------------------------------------------- 1 | # generated from XKB map pt 2 | include common 3 | map 0x816 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | at 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | numbersign 0x04 shift 11 | sterling 0x04 altgr 12 | dollar 0x05 shift 13 | section 0x05 altgr 14 | percent 0x06 shift 15 | onehalf 0x06 altgr 16 | threeeighths 0x06 shift altgr 17 | ampersand 0x07 shift 18 | threequarters 0x07 altgr 19 | fiveeighths 0x07 shift altgr 20 | slash 0x08 shift 21 | braceleft 0x08 altgr 22 | seveneighths 0x08 shift altgr 23 | parenleft 0x09 shift 24 | bracketleft 0x09 altgr 25 | trademark 0x09 shift altgr 26 | parenright 0x0a shift 27 | bracketright 0x0a altgr 28 | plusminus 0x0a shift altgr 29 | equal 0x0b shift 30 | braceright 0x0b altgr 31 | degree 0x0b shift altgr 32 | apostrophe 0x0c 33 | question 0x0c shift 34 | backslash 0x0c altgr 35 | questiondown 0x0c shift altgr 36 | guillemotleft 0x0d 37 | guillemotright 0x0d shift 38 | dead_cedilla 0x0d altgr 39 | dead_ogonek 0x0d shift altgr 40 | Greek_OMEGA 0x10 shift altgr 41 | lstroke 0x11 altgr 42 | Lstroke 0x11 shift altgr 43 | EuroSign 0x12 altgr 44 | cent 0x12 shift altgr 45 | paragraph 0x13 altgr 46 | registered 0x13 shift altgr 47 | tslash 0x14 altgr 48 | Tslash 0x14 shift altgr 49 | leftarrow 0x15 altgr 50 | yen 0x15 shift altgr 51 | downarrow 0x16 altgr 52 | uparrow 0x16 shift altgr 53 | rightarrow 0x17 altgr 54 | idotless 0x17 shift altgr 55 | oslash 0x18 altgr 56 | Ooblique 0x18 shift altgr 57 | thorn 0x19 altgr 58 | THORN 0x19 shift altgr 59 | plus 0x1a 60 | asterisk 0x1a shift 61 | dead_diaeresis 0x1a altgr 62 | dead_abovering 0x1a shift altgr 63 | dead_acute 0x1b 64 | dead_grave 0x1b shift 65 | dead_tilde 0x1b altgr 66 | dead_macron 0x1b shift altgr 67 | ae 0x1e altgr 68 | AE 0x1e shift altgr 69 | ssharp 0x1f altgr 70 | eth 0x20 altgr 71 | ETH 0x20 shift altgr 72 | dstroke 0x21 altgr 73 | ordfeminine 0x21 shift altgr 74 | eng 0x22 altgr 75 | ENG 0x22 shift altgr 76 | hstroke 0x23 altgr 77 | Hstroke 0x23 shift altgr 78 | kra 0x25 altgr 79 | lstroke 0x26 altgr 80 | Lstroke 0x26 shift altgr 81 | ccedilla 0x27 82 | Ccedilla 0x27 shift 83 | dead_doubleacute 0x27 shift altgr 84 | masculine 0x28 85 | ordfeminine 0x28 shift 86 | dead_circumflex 0x28 altgr 87 | dead_caron 0x28 shift altgr 88 | backslash 0x29 89 | bar 0x29 shift 90 | notsign 0x29 altgr 91 | dead_tilde 0x2b 92 | dead_circumflex 0x2b shift 93 | dead_breve 0x2b shift altgr 94 | less 0x56 95 | greater 0x56 shift 96 | cent 0x2e altgr 97 | copyright 0x2e shift altgr 98 | leftdoublequotemark 0x2f altgr 99 | grave 0x2f shift altgr 100 | rightdoublequotemark 0x30 altgr 101 | mu 0x32 altgr 102 | comma 0x33 103 | semicolon 0x33 shift 104 | horizconnector 0x33 altgr 105 | multiply 0x33 shift altgr 106 | period 0x34 107 | colon 0x34 shift 108 | periodcentered 0x34 altgr 109 | division 0x34 shift altgr 110 | minus 0x35 111 | underscore 0x35 shift 112 | dead_belowdot 0x35 altgr 113 | dead_abovedot 0x35 shift altgr 114 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/pt-br: -------------------------------------------------------------------------------- 1 | # generated from XKB map br 2 | include common 3 | map 0x416 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | at 0x03 shift 8 | twosuperior 0x03 altgr 9 | onehalf 0x03 shift altgr 10 | numbersign 0x04 shift 11 | threesuperior 0x04 altgr 12 | threequarters 0x04 shift altgr 13 | dollar 0x05 shift 14 | sterling 0x05 altgr 15 | onequarter 0x05 shift altgr 16 | percent 0x06 shift 17 | cent 0x06 altgr 18 | dead_diaeresis 0x07 shift 19 | notsign 0x07 altgr 20 | diaeresis 0x07 shift altgr 21 | ampersand 0x08 shift 22 | braceleft 0x08 altgr 23 | asterisk 0x09 shift 24 | bracketleft 0x09 altgr 25 | parenleft 0x0a shift 26 | bracketright 0x0a altgr 27 | parenright 0x0b shift 28 | braceright 0x0b altgr 29 | minus 0x0c 30 | underscore 0x0c shift 31 | backslash 0x0c altgr 32 | equal 0x0d 33 | plus 0x0d shift 34 | section 0x0d altgr 35 | EuroSign 0x12 altgr 36 | registered 0x13 altgr 37 | dead_acute 0x1a 38 | dead_grave 0x1a shift 39 | acute 0x1a altgr 40 | grave 0x1a shift altgr 41 | bracketleft 0x1b 42 | braceleft 0x1b shift 43 | ordfeminine 0x1b altgr 44 | ccedilla 0x27 45 | Ccedilla 0x27 shift 46 | dead_tilde 0x28 47 | dead_circumflex 0x28 shift 48 | asciitilde 0x28 altgr 49 | asciicircum 0x28 shift altgr 50 | apostrophe 0x29 51 | quotedbl 0x29 shift 52 | bracketright 0x2b 53 | braceright 0x2b shift 54 | masculine 0x2b altgr 55 | copyright 0x2e altgr 56 | mu 0x32 altgr 57 | comma 0x33 58 | less 0x33 shift 59 | period 0x34 60 | greater 0x34 shift 61 | semicolon 0x35 62 | colon 0x35 shift 63 | comma 0x53 numlock 64 | backslash 0x56 65 | bar 0x56 shift 66 | slash 0x73 67 | question 0x73 shift 68 | degree 0x73 altgr 69 | KP_Decimal 0x34 70 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/ru: -------------------------------------------------------------------------------- 1 | # generated from XKB map ru 2 | include common 3 | map 0x419 4 | exclam 0x02 shift 5 | at 0x03 shift 6 | quotedbl 0x03 shift altgr 7 | numbersign 0x04 shift 8 | dollar 0x05 shift 9 | asterisk 0x05 shift altgr 10 | percent 0x06 shift 11 | colon 0x06 shift altgr 12 | asciicircum 0x07 shift 13 | comma 0x07 shift altgr 14 | ampersand 0x08 shift 15 | period 0x08 shift altgr 16 | asterisk 0x09 shift 17 | semicolon 0x09 shift altgr 18 | parenleft 0x0a shift 19 | parenright 0x0b shift 20 | minus 0x0c 21 | underscore 0x0c shift 22 | equal 0x0d 23 | plus 0x0d shift 24 | Cyrillic_shorti 0x10 altgr 25 | Cyrillic_SHORTI 0x10 shift altgr 26 | Cyrillic_tse 0x11 altgr 27 | Cyrillic_TSE 0x11 shift altgr 28 | Cyrillic_u 0x12 altgr 29 | Cyrillic_U 0x12 shift altgr 30 | Cyrillic_ka 0x13 altgr 31 | Cyrillic_KA 0x13 shift altgr 32 | Cyrillic_ie 0x14 altgr 33 | Cyrillic_IE 0x14 shift altgr 34 | Cyrillic_en 0x15 altgr 35 | Cyrillic_EN 0x15 shift altgr 36 | Cyrillic_ghe 0x16 altgr 37 | Cyrillic_GHE 0x16 shift altgr 38 | Cyrillic_sha 0x17 altgr 39 | Cyrillic_SHA 0x17 shift altgr 40 | Cyrillic_shcha 0x18 altgr 41 | Cyrillic_SHCHA 0x18 shift altgr 42 | Cyrillic_ze 0x19 altgr 43 | Cyrillic_ZE 0x19 shift altgr 44 | bracketleft 0x1a 45 | braceleft 0x1a shift 46 | Cyrillic_ha 0x1a altgr 47 | Cyrillic_HA 0x1a shift altgr 48 | bracketright 0x1b 49 | braceright 0x1b shift 50 | Cyrillic_hardsign 0x1b altgr 51 | Cyrillic_HARDSIGN 0x1b shift altgr 52 | Cyrillic_ef 0x1e altgr 53 | Cyrillic_EF 0x1e shift altgr 54 | Cyrillic_yeru 0x1f altgr 55 | Cyrillic_YERU 0x1f shift altgr 56 | Cyrillic_ve 0x20 altgr 57 | Cyrillic_VE 0x20 shift altgr 58 | Cyrillic_a 0x21 altgr 59 | Cyrillic_A 0x21 shift altgr 60 | Cyrillic_pe 0x22 altgr 61 | Cyrillic_PE 0x22 shift altgr 62 | Cyrillic_er 0x23 altgr 63 | Cyrillic_ER 0x23 shift altgr 64 | Cyrillic_o 0x24 altgr 65 | Cyrillic_O 0x24 shift altgr 66 | Cyrillic_el 0x25 altgr 67 | Cyrillic_EL 0x25 shift altgr 68 | Cyrillic_de 0x26 altgr 69 | Cyrillic_DE 0x26 shift altgr 70 | semicolon 0x27 71 | colon 0x27 shift 72 | Cyrillic_zhe 0x27 altgr 73 | Cyrillic_ZHE 0x27 shift altgr 74 | apostrophe 0x28 75 | quotedbl 0x28 shift 76 | Cyrillic_e 0x28 altgr 77 | Cyrillic_E 0x28 shift altgr 78 | grave 0x29 79 | asciitilde 0x29 shift 80 | Cyrillic_io 0x29 altgr 81 | Cyrillic_IO 0x29 shift altgr 82 | backslash 0x2b 83 | bar 0x2b shift 84 | Cyrillic_ya 0x2c altgr 85 | Cyrillic_YA 0x2c shift altgr 86 | Cyrillic_che 0x2d altgr 87 | Cyrillic_CHE 0x2d shift altgr 88 | Cyrillic_es 0x2e altgr 89 | Cyrillic_ES 0x2e shift altgr 90 | Cyrillic_em 0x2f altgr 91 | Cyrillic_EM 0x2f shift altgr 92 | Cyrillic_i 0x30 altgr 93 | Cyrillic_I 0x30 shift altgr 94 | Cyrillic_te 0x31 altgr 95 | Cyrillic_TE 0x31 shift altgr 96 | Cyrillic_softsign 0x32 altgr 97 | Cyrillic_SOFTSIGN 0x32 shift altgr 98 | comma 0x33 99 | less 0x33 shift 100 | Cyrillic_be 0x33 altgr 101 | Cyrillic_BE 0x33 shift altgr 102 | period 0x34 103 | greater 0x34 shift 104 | Cyrillic_yu 0x34 altgr 105 | Cyrillic_YU 0x34 shift altgr 106 | slash 0x35 107 | question 0x35 shift 108 | slash 0x56 altgr 109 | bar 0x56 shift altgr 110 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/sl: -------------------------------------------------------------------------------- 1 | # generated from XKB map sl 2 | include common 3 | map 0x424 4 | exclam 0x02 shift 5 | asciitilde 0x02 altgr 6 | dead_tilde 0x02 shift altgr 7 | quotedbl 0x03 shift 8 | dead_caron 0x03 altgr 9 | caron 0x03 shift altgr 10 | numbersign 0x04 shift 11 | asciicircum 0x04 altgr 12 | dead_circumflex 0x04 shift altgr 13 | dollar 0x05 shift 14 | dead_breve 0x05 altgr 15 | breve 0x05 shift altgr 16 | percent 0x06 shift 17 | degree 0x06 altgr 18 | dead_abovering 0x06 shift altgr 19 | ampersand 0x07 shift 20 | dead_ogonek 0x07 altgr 21 | ogonek 0x07 shift altgr 22 | slash 0x08 shift 23 | grave 0x08 altgr 24 | dead_grave 0x08 shift altgr 25 | parenleft 0x09 shift 26 | dead_abovedot 0x09 altgr 27 | abovedot 0x09 shift altgr 28 | parenright 0x0a shift 29 | dead_acute 0x0a altgr 30 | equal 0x0b shift 31 | dead_doubleacute 0x0b altgr 32 | doubleacute 0x0b shift altgr 33 | apostrophe 0x0c 34 | question 0x0c shift 35 | dead_diaeresis 0x0c altgr 36 | diaeresis 0x0c shift altgr 37 | plus 0x0d 38 | asterisk 0x0d shift 39 | dead_cedilla 0x0d altgr 40 | cedilla 0x0d shift altgr 41 | backslash 0x10 altgr 42 | Greek_OMEGA 0x10 shift altgr 43 | bar 0x11 altgr 44 | Lstroke 0x11 shift altgr 45 | EuroSign 0x12 altgr 46 | paragraph 0x13 altgr 47 | registered 0x13 shift altgr 48 | tslash 0x14 altgr 49 | Tslash 0x14 shift altgr 50 | z 0x15 addupper 51 | leftarrow 0x15 altgr 52 | yen 0x15 shift altgr 53 | downarrow 0x16 altgr 54 | uparrow 0x16 shift altgr 55 | rightarrow 0x17 altgr 56 | idotless 0x17 shift altgr 57 | oslash 0x18 altgr 58 | Ooblique 0x18 shift altgr 59 | thorn 0x19 altgr 60 | THORN 0x19 shift altgr 61 | scaron 0x1a 62 | Scaron 0x1a shift 63 | division 0x1a altgr 64 | dstroke 0x1b 65 | Dstroke 0x1b shift 66 | multiply 0x1b altgr 67 | dead_macron 0x1b shift altgr 68 | ae 0x1e altgr 69 | AE 0x1e shift altgr 70 | ssharp 0x1f altgr 71 | section 0x1f shift altgr 72 | eth 0x20 altgr 73 | ETH 0x20 shift altgr 74 | bracketleft 0x21 altgr 75 | ordfeminine 0x21 shift altgr 76 | bracketright 0x22 altgr 77 | ENG 0x22 shift altgr 78 | hstroke 0x23 altgr 79 | Hstroke 0x23 shift altgr 80 | lstroke 0x25 altgr 81 | Lstroke 0x26 altgr 82 | ccaron 0x27 83 | Ccaron 0x27 shift 84 | cacute 0x28 85 | Cacute 0x28 shift 86 | ssharp 0x28 altgr 87 | dead_cedilla 0x29 88 | notsign 0x29 altgr 89 | zcaron 0x2b 90 | Zcaron 0x2b shift 91 | currency 0x2b altgr 92 | y 0x2c addupper 93 | guillemotleft 0x2c altgr 94 | guillemotright 0x2d altgr 95 | cent 0x2e altgr 96 | copyright 0x2e shift altgr 97 | at 0x2f altgr 98 | braceleft 0x30 altgr 99 | braceright 0x31 altgr 100 | section 0x32 altgr 101 | masculine 0x32 shift altgr 102 | comma 0x33 103 | semicolon 0x33 shift 104 | horizconnector 0x33 altgr 105 | period 0x34 106 | colon 0x34 shift 107 | periodcentered 0x34 altgr 108 | minus 0x35 109 | underscore 0x35 shift 110 | dead_belowdot 0x35 altgr 111 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/sv: -------------------------------------------------------------------------------- 1 | map 0x0000041d 2 | include common 3 | 4 | # 5 | # Top row 6 | # 7 | section 0x29 8 | onehalf 0x29 shift 9 | 10 | # 1 11 | exclam 0x2 shift 12 | 13 | # 2 14 | quotedbl 0x3 shift 15 | at 0x3 altgr 16 | 17 | # 3 18 | numbersign 0x4 shift 19 | sterling 0x4 altgr 20 | # 4 21 | currency 0x5 shift 22 | dollar 0x5 altgr 23 | # 5 24 | percent 0x6 shift 25 | # 6 26 | ampersand 0x7 shift 27 | # 7 28 | slash 0x8 shift 29 | braceleft 0x8 altgr 30 | # 8 31 | parenleft 0x9 shift 32 | bracketleft 0x9 altgr 33 | # 9 34 | parenright 0xa shift 35 | bracketright 0xa altgr 36 | # 0 37 | equal 0xb shift 38 | braceright 0xb altgr 39 | 40 | plus 0xc 41 | question 0xc shift 42 | backslash 0xc altgr 43 | 44 | acute 0xd 45 | dead_acute 0xd 46 | grave 0xd shift 47 | dead_grave 0xd shift 48 | 49 | # 50 | # QWERTY first row 51 | # 52 | EuroSign 0x12 altgr 53 | aring 0x1a 54 | Aring 0x1a shift 55 | dead_diaeresis 0x1b 56 | dead_circumflex 0x1b shift 57 | dead_tilde 0x1b altgr 58 | 59 | # 60 | # QWERTY second row 61 | # 62 | odiaeresis 0x27 63 | Odiaeresis 0x27 shift 64 | adiaeresis 0x28 65 | Adiaeresis 0x28 shift 66 | apostrophe 0x2b 67 | asterisk 0x2b shift 68 | 69 | # 70 | # QWERTY third row 71 | # 72 | less 0x56 73 | greater 0x56 shift 74 | bar 0x56 altgr 75 | mu 0x32 altgr 76 | comma 0x33 77 | semicolon 0x33 shift 78 | period 0x34 79 | colon 0x34 shift 80 | minus 0x35 81 | underscore 0x35 shift 82 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/th: -------------------------------------------------------------------------------- 1 | # generated from XKB map th 2 | include common 3 | map 0x41e 4 | exclam 0x02 shift 5 | Thai_lakkhangyao 0x02 altgr 6 | plus 0x02 shift altgr 7 | at 0x03 shift 8 | slash 0x03 altgr 9 | Thai_leknung 0x03 shift altgr 10 | numbersign 0x04 shift 11 | minus 0x04 altgr 12 | Thai_leksong 0x04 shift altgr 13 | dollar 0x05 shift 14 | Thai_phosamphao 0x05 altgr 15 | Thai_leksam 0x05 shift altgr 16 | percent 0x06 shift 17 | Thai_thothung 0x06 altgr 18 | Thai_leksi 0x06 shift altgr 19 | asciicircum 0x07 shift 20 | Thai_sarau 0x07 altgr 21 | Thai_sarauu 0x07 shift altgr 22 | ampersand 0x08 shift 23 | Thai_saraue 0x08 altgr 24 | Thai_baht 0x08 shift altgr 25 | asterisk 0x09 shift 26 | Thai_khokhwai 0x09 altgr 27 | Thai_lekha 0x09 shift altgr 28 | parenleft 0x0a shift 29 | Thai_totao 0x0a altgr 30 | Thai_lekhok 0x0a shift altgr 31 | parenright 0x0b shift 32 | Thai_chochan 0x0b altgr 33 | Thai_lekchet 0x0b shift altgr 34 | minus 0x0c 35 | underscore 0x0c shift 36 | Thai_khokhai 0x0c altgr 37 | Thai_lekpaet 0x0c shift altgr 38 | equal 0x0d 39 | plus 0x0d shift 40 | Thai_chochang 0x0d altgr 41 | Thai_lekkao 0x0d shift altgr 42 | Thai_maiyamok 0x10 altgr 43 | Thai_leksun 0x10 shift altgr 44 | Thai_saraaimaimalai 0x11 altgr 45 | quotedbl 0x11 shift altgr 46 | Thai_saraam 0x12 altgr 47 | Thai_dochada 0x12 shift altgr 48 | Thai_phophan 0x13 altgr 49 | Thai_thonangmontho 0x13 shift altgr 50 | Thai_saraa 0x14 altgr 51 | Thai_thothong 0x14 shift altgr 52 | Thai_maihanakat 0x15 altgr 53 | Thai_nikhahit 0x15 shift altgr 54 | Thai_saraii 0x16 altgr 55 | Thai_maitri 0x16 shift altgr 56 | Thai_rorua 0x17 altgr 57 | Thai_nonen 0x17 shift altgr 58 | Thai_nonu 0x18 altgr 59 | Thai_paiyannoi 0x18 shift altgr 60 | Thai_yoyak 0x19 altgr 61 | Thai_yoying 0x19 shift altgr 62 | bracketleft 0x1a 63 | braceleft 0x1a shift 64 | Thai_bobaimai 0x1a altgr 65 | Thai_thothan 0x1a shift altgr 66 | bracketright 0x1b 67 | braceright 0x1b shift 68 | Thai_loling 0x1b altgr 69 | comma 0x1b shift altgr 70 | Thai_fofan 0x1e altgr 71 | Thai_ru 0x1e shift altgr 72 | Thai_hohip 0x1f altgr 73 | Thai_khorakhang 0x1f shift altgr 74 | Thai_kokai 0x20 altgr 75 | Thai_topatak 0x20 shift altgr 76 | Thai_dodek 0x21 altgr 77 | Thai_sarao 0x21 shift altgr 78 | Thai_sarae 0x22 altgr 79 | Thai_chochoe 0x22 shift altgr 80 | Thai_maitho 0x23 altgr 81 | Thai_maitaikhu 0x23 shift altgr 82 | Thai_maiek 0x24 altgr 83 | Thai_maichattawa 0x24 shift altgr 84 | Thai_saraaa 0x25 altgr 85 | Thai_sorusi 0x25 shift altgr 86 | Thai_sosua 0x26 altgr 87 | Thai_sosala 0x26 shift altgr 88 | semicolon 0x27 89 | colon 0x27 shift 90 | Thai_wowaen 0x27 altgr 91 | Thai_soso 0x27 shift altgr 92 | apostrophe 0x28 93 | quotedbl 0x28 shift 94 | Thai_ngongu 0x28 altgr 95 | period 0x28 shift altgr 96 | grave 0x29 97 | asciitilde 0x29 shift 98 | underscore 0x29 altgr 99 | percent 0x29 shift altgr 100 | ISO_First_Group 0x2a shift 101 | backslash 0x2b 102 | bar 0x2b shift 103 | Thai_khokhuat 0x2b altgr 104 | Thai_khokhon 0x2b shift altgr 105 | Thai_phophung 0x2c altgr 106 | parenleft 0x2c shift altgr 107 | Thai_popla 0x2d altgr 108 | parenright 0x2d shift altgr 109 | Thai_saraae 0x2e altgr 110 | Thai_choching 0x2e shift altgr 111 | Thai_oang 0x2f altgr 112 | Thai_honokhuk 0x2f shift altgr 113 | Thai_sarai 0x30 altgr 114 | Thai_phinthu 0x30 shift altgr 115 | Thai_sarauee 0x31 altgr 116 | Thai_thanthakhat 0x31 shift altgr 117 | Thai_thothahan 0x32 altgr 118 | question 0x32 shift altgr 119 | comma 0x33 120 | less 0x33 shift 121 | Thai_moma 0x33 altgr 122 | Thai_thophuthao 0x33 shift altgr 123 | period 0x34 124 | greater 0x34 shift 125 | Thai_saraaimaimuan 0x34 altgr 126 | Thai_lochula 0x34 shift altgr 127 | slash 0x35 128 | question 0x35 shift 129 | Thai_fofa 0x35 altgr 130 | Thai_lu 0x35 shift altgr 131 | ISO_Last_Group 0x36 shift 132 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/keymaps/tr: -------------------------------------------------------------------------------- 1 | # generated from XKB map tr 2 | include common 3 | map 0x41f 4 | exclam 0x02 shift 5 | onesuperior 0x02 altgr 6 | exclamdown 0x02 shift altgr 7 | apostrophe 0x03 shift 8 | at 0x03 altgr 9 | oneeighth 0x03 shift altgr 10 | dead_circumflex 0x04 shift 11 | numbersign 0x04 altgr 12 | sterling 0x04 shift altgr 13 | plus 0x05 shift 14 | dollar 0x05 altgr 15 | percent 0x06 shift 16 | onehalf 0x06 altgr 17 | threeeighths 0x06 shift altgr 18 | ampersand 0x07 shift 19 | asciicircum 0x07 altgr 20 | fiveeighths 0x07 shift altgr 21 | slash 0x08 shift 22 | braceleft 0x08 altgr 23 | seveneighths 0x08 shift altgr 24 | parenleft 0x09 shift 25 | bracketleft 0x09 altgr 26 | trademark 0x09 shift altgr 27 | parenright 0x0a shift 28 | bracketright 0x0a altgr 29 | plusminus 0x0a shift altgr 30 | equal 0x0b shift 31 | braceright 0x0b altgr 32 | degree 0x0b shift altgr 33 | asterisk 0x0c 34 | question 0x0c shift 35 | backslash 0x0c altgr 36 | questiondown 0x0c shift altgr 37 | minus 0x0d 38 | underscore 0x0d shift 39 | dead_cedilla 0x0d altgr 40 | dead_ogonek 0x0d shift altgr 41 | at 0x10 altgr 42 | Greek_OMEGA 0x10 shift altgr 43 | lstroke 0x11 altgr 44 | Lstroke 0x11 shift altgr 45 | EuroSign 0x12 altgr 46 | paragraph 0x13 altgr 47 | registered 0x13 shift altgr 48 | tslash 0x14 altgr 49 | Tslash 0x14 shift altgr 50 | leftarrow 0x15 altgr 51 | yen 0x15 shift altgr 52 | downarrow 0x16 altgr 53 | uparrow 0x16 shift altgr 54 | idotless 0x17 55 | I 0x17 shift 56 | rightarrow 0x17 altgr 57 | oslash 0x18 altgr 58 | Ooblique 0x18 shift altgr 59 | thorn 0x19 altgr 60 | THORN 0x19 shift altgr 61 | gbreve 0x1a 62 | Gbreve 0x1a shift 63 | dead_diaeresis 0x1a altgr 64 | dead_abovering 0x1a shift altgr 65 | udiaeresis 0x1b 66 | Udiaeresis 0x1b shift 67 | asciitilde 0x1b altgr 68 | dead_macron 0x1b shift altgr 69 | ae 0x1e altgr 70 | AE 0x1e shift altgr 71 | ssharp 0x1f altgr 72 | section 0x1f shift altgr 73 | eth 0x20 altgr 74 | ETH 0x20 shift altgr 75 | dstroke 0x21 altgr 76 | ordfeminine 0x21 shift altgr 77 | eng 0x22 altgr 78 | ENG 0x22 shift altgr 79 | hstroke 0x23 altgr 80 | Hstroke 0x23 shift altgr 81 | kra 0x25 altgr 82 | ampersand 0x25 shift altgr 83 | lstroke 0x26 altgr 84 | Lstroke 0x26 shift altgr 85 | scedilla 0x27 86 | Scedilla 0x27 shift 87 | dead_acute 0x27 altgr 88 | dead_doubleacute 0x27 shift altgr 89 | i 0x28 90 | Iabovedot 0x28 shift 91 | dead_circumflex 0x28 altgr 92 | dead_caron 0x28 shift altgr 93 | backslash 0x29 94 | quotedbl 0x29 shift 95 | asciitilde 0x29 altgr 96 | comma 0x2b 97 | semicolon 0x2b shift 98 | bar 0x2b altgr 99 | dead_breve 0x2b shift altgr 100 | guillemotleft 0x2c altgr 101 | less 0x2c shift altgr 102 | guillemotright 0x2d altgr 103 | greater 0x2d shift altgr 104 | cent 0x2e altgr 105 | copyright 0x2e shift altgr 106 | leftdoublequotemark 0x2f altgr 107 | grave 0x2f shift altgr 108 | rightdoublequotemark 0x30 altgr 109 | apostrophe 0x30 shift altgr 110 | mu 0x32 altgr 111 | masculine 0x32 shift altgr 112 | odiaeresis 0x33 113 | Odiaeresis 0x33 shift 114 | less 0x33 altgr 115 | multiply 0x33 shift altgr 116 | ccedilla 0x34 117 | Ccedilla 0x34 shift 118 | greater 0x34 altgr 119 | division 0x34 shift altgr 120 | period 0x35 121 | colon 0x35 shift 122 | dead_belowdot 0x35 altgr 123 | dead_abovedot 0x35 shift altgr 124 | -------------------------------------------------------------------------------- /qemu-bin/share/qemu/linuxboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/linuxboot.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/mpc8544ds.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/mpc8544ds.dtb -------------------------------------------------------------------------------- /qemu-bin/share/qemu/multiboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/multiboot.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/openbios-ppc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/openbios-ppc -------------------------------------------------------------------------------- /qemu-bin/share/qemu/openbios-sparc32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/openbios-sparc32 -------------------------------------------------------------------------------- /qemu-bin/share/qemu/openbios-sparc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/openbios-sparc64 -------------------------------------------------------------------------------- /qemu-bin/share/qemu/petalogix-ml605.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/petalogix-ml605.dtb -------------------------------------------------------------------------------- /qemu-bin/share/qemu/petalogix-s3adsp1800.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/petalogix-s3adsp1800.dtb -------------------------------------------------------------------------------- /qemu-bin/share/qemu/ppc_rom.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/ppc_rom.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/pxe-e1000.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/pxe-e1000.rom -------------------------------------------------------------------------------- /qemu-bin/share/qemu/pxe-eepro100.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/pxe-eepro100.rom -------------------------------------------------------------------------------- /qemu-bin/share/qemu/pxe-ne2k_pci.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/pxe-ne2k_pci.rom -------------------------------------------------------------------------------- /qemu-bin/share/qemu/pxe-pcnet.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/pxe-pcnet.rom -------------------------------------------------------------------------------- /qemu-bin/share/qemu/pxe-rtl8139.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/pxe-rtl8139.rom -------------------------------------------------------------------------------- /qemu-bin/share/qemu/pxe-virtio.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/pxe-virtio.rom -------------------------------------------------------------------------------- /qemu-bin/share/qemu/s390-zipl.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/s390-zipl.rom -------------------------------------------------------------------------------- /qemu-bin/share/qemu/slof.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/slof.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/spapr-rtas.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/spapr-rtas.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/vgabios-cirrus.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/vgabios-cirrus.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/vgabios-qxl.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/vgabios-qxl.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/vgabios-stdvga.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/vgabios-stdvga.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/vgabios-vmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/vgabios-vmware.bin -------------------------------------------------------------------------------- /qemu-bin/share/qemu/vgabios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawxChen/-LibraryOS-Exokernel_Implementation/e0c5b5c82b906a8bce8c408b449a4ecb493000ae/qemu-bin/share/qemu/vgabios.bin -------------------------------------------------------------------------------- /upcode_util/Arg_split.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import optparse,sys 3 | 4 | class Arg_split: 5 | splittee = optparse.OptionParser() 6 | def __init__(self, usage): 7 | self.splittee.add_option("-d", type = "str", default = ".", dest="dir_entry",help="default value is \".\"") 8 | self.splittee.add_option("-p", type = "str", default = ".S .s .c .h", dest="prop_file",help="default value is \".S .s .c .h\"") 9 | self.splittee.add_option("-w", type = "str", default = None, dest="keyword") 10 | self.splittee.add_option("-A", action = "store_true", default = False, dest="ascii", help="-A show colored keyword ") 11 | 12 | def default_split_out(self, _list = None): 13 | if(None == _list): 14 | _list = sys.argv[1:] 15 | 16 | opt, args = self.splittee.parse_args(_list) 17 | if(self.splittee.has_option("-w") and None == opt.keyword): 18 | print >> sys.stderr, "Wrong input", _list 19 | exit(); 20 | return opt, args 21 | -------------------------------------------------------------------------------- /upcode_util/cscope.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -name "*.h" -o -name "*.c" -o -name "*.S" > cscope.file 3 | cscope -bkq -i cscope.file 4 | ctags -Rb 5 | -------------------------------------------------------------------------------- /upcode_util/indent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -name '*.c'| xargs indent -nbad -bap -nbc -bbo -bl -bli0 -bls -ncdb -ncdw -nce -cp1 -cs -di1 -ndj -nfc1 -nfca -hnl -i4 -ip5 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob -nut -ts4 3 | find . -name '*.h'| xargs indent -nbad -bap -nbc -bbo -bl -bli0 -bls -ncdb -ncdw -nce -cp1 -cs -di1 -ndj -nfc1 -nfca -hnl -i4 -ip5 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob -nut -ts4 4 | find . -name '*.h~' | xargs rm 5 | find . -name '*.c~' | xargs rm 6 | -------------------------------------------------------------------------------- /upcode_util/listKeywordFile.py: -------------------------------------------------------------------------------- 1 | #/usr/bin/python 2 | import os,re,sys 3 | import Arg_split 4 | #import ASCII_Color 5 | 6 | codeCodes = { 7 | 'black': '0;30', 'bright gray': '0;37', 8 | 'blue': '0;34', 'white': '1;37', 9 | 'green': '0;32', 'bright blue': '1;34', 10 | 'cyan': '0;36', 'bright green': '1;32', 11 | 'red': '0;31', 'bright cyan': '1;36', 12 | 'purple': '0;35', 'bright red': '1;31', 13 | 'yellow': '0;33', 'bright purple':'1;35', 14 | 'dark gray':'1;30', 'bright yellow':'1;33', 15 | 'normal': '0' 16 | } 17 | 18 | def printc(text, color): 19 | """Print in color.""" 20 | print "\033["+codeCodes[color]+"m"+text+"\033[0m" 21 | 22 | def writec(text, color): 23 | """Write to stdout in color.""" 24 | sys.stdout.write("\033["+codeCodes[color]+"m"+text+"\033[0m") 25 | 26 | def switchColor(color): 27 | """Switch console color.""" 28 | sys.stdout.write("\033["+codeCodes[color]+"m") 29 | 30 | def paintc(text,color): 31 | return "\033["+codeCodes[color]+"m"+text+"\033[0m" 32 | 33 | #function. show file name show the line 34 | def _list_needed_file(opt,args): 35 | _prop_list = opt.prop_file.split(" ") 36 | keyword_color = "cyan" 37 | file_cnt = 0 38 | keyword_total_cnt = 0 39 | for(_path, _dirs, _files) in os.walk(opt.dir_entry): 40 | for _file_name in _files: 41 | if(opt.prop_file != "-1" and not (_file_name.count(".") and _file_name[_file_name.rindex("."):] in _prop_list)): 42 | continue 43 | try: 44 | fd = open(_path+ os.sep + _file_name,"rb") 45 | except IOError: 46 | continue 47 | fd_content = fd.readlines() 48 | _1st_found = True 49 | for (index, line) in enumerate(fd_content): 50 | keyword_cnt_each_line = line.count(opt.keyword) 51 | if(keyword_cnt_each_line <= 0): 52 | continue 53 | 54 | if(_1st_found == True): 55 | file_cnt = file_cnt + 1; 56 | print "\n","["+ str(file_cnt) +"]"+_path + os.sep + _file_name 57 | _1st_found = False 58 | 59 | # print "\t" "["+ str(keyword_cnt_each_line) +"]", index +1, line.replace(opt.keyword, paintc(opt.keyword,keyword_color)), 60 | if(opt.ascii): 61 | print "\t" , index +1, line.replace(opt.keyword, paintc(opt.keyword,keyword_color)), 62 | else: 63 | print "\t" , index +1, line, 64 | keyword_total_cnt = keyword_total_cnt + keyword_cnt_each_line 65 | fd.close() 66 | print "\nCalculation:" 67 | print "The number of File owning keyword: " + str(file_cnt) 68 | print "The keyword count: " + str(keyword_total_cnt) 69 | 70 | return 71 | if __name__ == '__main__': 72 | splitter = Arg_split.Arg_split("./listKeywordFile.py -w keyword") 73 | opt, args = splitter.default_split_out() 74 | _list_needed_file(opt,args) 75 | 76 | #To do 77 | #repeat keyword in the line 1.count 2. chang their color : use the smart way(like re to change all.) to replace. 78 | -------------------------------------------------------------------------------- /user/Makefrag: -------------------------------------------------------------------------------- 1 | OBJDIRS += user 2 | 3 | $(OBJDIR)/user/%.o: user/%.c 4 | @echo + cc[USER] $< 5 | @mkdir -p $(@D) 6 | $(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $< 7 | 8 | $(OBJDIR)/user/%: $(OBJDIR)/user/%.o $(OBJDIR)/lib/entry.o $(OBJDIR)/lib/libjos.a user/user.ld 9 | @echo + ld $@ 10 | $(V)$(LD) -o $@ $(ULDFLAGS) $(LDFLAGS) -nostdlib $(OBJDIR)/lib/entry.o $@.o -L$(OBJDIR)/lib -ljos $(GCC_LIB) 11 | $(V)$(OBJDUMP) -S $@ > $@.asm 12 | $(V)$(NM) -n $@ > $@.sym 13 | -------------------------------------------------------------------------------- /user/badsegment.c: -------------------------------------------------------------------------------- 1 | // program to cause a general protection exception 2 | 3 | #include 4 | 5 | void 6 | umain (int argc, char **argv) 7 | { 8 | // Try to load the kernel's TSS selector into the DS register. 9 | asm volatile ("movw $0x28,%ax; movw %ax,%ds"); 10 | } 11 | -------------------------------------------------------------------------------- /user/breakpoint.c: -------------------------------------------------------------------------------- 1 | // program to cause a breakpoint trap 2 | 3 | #include 4 | 5 | void 6 | umain (int argc, char **argv) 7 | { 8 | asm volatile ("int $3"); 9 | } 10 | -------------------------------------------------------------------------------- /user/buggyhello.c: -------------------------------------------------------------------------------- 1 | // buggy hello world -- unmapped pointer passed to kernel 2 | // kernel should destroy user environment in response 3 | 4 | #include 5 | 6 | void 7 | umain (int argc, char **argv) 8 | { 9 | sys_cputs ((char *) 1, 1); 10 | } 11 | -------------------------------------------------------------------------------- /user/buggyhello2.c: -------------------------------------------------------------------------------- 1 | // buggy hello world 2 -- pointed-to region extends into unmapped memory 2 | // kernel should destroy user environment in response 3 | 4 | #include 5 | 6 | const char *hello = "hello, world\n"; 7 | 8 | void 9 | umain (int argc, char **argv) 10 | { 11 | sys_cputs (hello, 1024 * 1024); 12 | } 13 | -------------------------------------------------------------------------------- /user/divzero.c: -------------------------------------------------------------------------------- 1 | // buggy program - causes a divide by zero exception 2 | 3 | #include 4 | 5 | int zero; 6 | 7 | void 8 | umain (int argc, char **argv) 9 | { 10 | zero = 0; 11 | cprintf ("1/0 is %08x!\n", 1 / zero); 12 | } 13 | -------------------------------------------------------------------------------- /user/dumbfork.c: -------------------------------------------------------------------------------- 1 | // Ping-pong a counter between two processes. 2 | // Only need to start one of these -- splits into two, crudely. 3 | 4 | #include 5 | #include 6 | 7 | envid_t dumbfork(void); 8 | 9 | void 10 | umain(int argc, char **argv) 11 | { 12 | envid_t who; 13 | int i; 14 | 15 | // fork a child process 16 | who = dumbfork(); 17 | 18 | // print a message and yield to the other a few times 19 | for (i = 0; i < (who ? 10 : 20); i++) { 20 | cprintf("%d: I am the %s!\n", i, who ? "parent" : "child"); 21 | sys_yield(); 22 | } 23 | } 24 | 25 | void 26 | duppage(envid_t dstenv, void *addr) 27 | { 28 | int r; 29 | 30 | // This is NOT what you should do in your fork. 31 | if ((r = sys_page_alloc(dstenv, addr, PTE_P|PTE_U|PTE_W)) < 0) 32 | panic("sys_page_alloc: %e!!!!!,dstenv:%d,addr:0x%08x\n", r,dstenv,(uint32_t)addr); 33 | if ((r = sys_page_map(dstenv, addr, 0, UTEMP, PTE_P|PTE_U|PTE_W)) < 0) 34 | panic("sys_page_map: %e!!!!!\n", r); 35 | memmove(UTEMP, addr, PGSIZE); 36 | if ((r = sys_page_unmap(0, UTEMP)) < 0) 37 | panic("sys_page_unmap: %e!!!!!\n", r); 38 | } 39 | 40 | envid_t 41 | dumbfork(void) 42 | { 43 | envid_t envid; 44 | uint8_t *addr; 45 | int r; 46 | extern unsigned char end[]; 47 | 48 | // Allocate a new child environment. 49 | // The kernel will initialize it with a copy of our register state, 50 | // so that the child will appear to have called sys_exofork() too - 51 | // except that in the child, this "fake" call to sys_exofork() 52 | // will return 0 instead of the envid of the child. 53 | envid = sys_exofork(); 54 | if (envid < 0) 55 | panic("sys_exofork: %e", envid); 56 | if (envid == 0) { 57 | // We're the child. 58 | // The copied value of the global variable 'thisenv' 59 | // is no longer valid (it refers to the parent!). 60 | // Fix it and return 0. 61 | cprintf("---Child reteurn--- \n"); 62 | thisenv = &envs[ENVX(sys_getenvid())]; 63 | return 0; 64 | } 65 | 66 | // We're the parent. 67 | // Eagerly copy our entire address space into the child. 68 | // This is NOT what you should do in your fork implementation. 69 | 70 | //cprintf("duppage From 0x%08x to 0x%08x\n",(uint32_t)UTEXT,(uint32_t)end); 71 | for (addr = (uint8_t*) UTEXT; addr < end; addr += PGSIZE) 72 | { 73 | duppage(envid, addr); 74 | } 75 | 76 | // Also copy the stack we are currently running on. 77 | duppage(envid, ROUNDDOWN(&addr, PGSIZE)); 78 | 79 | // Start the child environment running 80 | if ((r = sys_env_set_status(envid, ENV_RUNNABLE)) < 0) 81 | panic("sys_env_set_status: %e!!!!!\n", r); 82 | 83 | return envid; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /user/evilhello.c: -------------------------------------------------------------------------------- 1 | // evil hello world -- kernel pointer passed to kernel 2 | // kernel should destroy user environment in response 3 | 4 | #include 5 | 6 | void 7 | umain (int argc, char **argv) 8 | { 9 | // try to print the kernel entry point as a string! mua ha ha! 10 | sys_cputs ((char *) 0xf010000c, 100); 11 | } 12 | -------------------------------------------------------------------------------- /user/fairness.c: -------------------------------------------------------------------------------- 1 | // Demonstrate lack of fairness in IPC. 2 | // Start three instances of this program as envs 1, 2, and 3. 3 | // (user/idle is env 0). 4 | 5 | #include 6 | 7 | void 8 | umain(int argc, char **argv) 9 | { 10 | envid_t who, id; 11 | 12 | id = sys_getenvid(); 13 | 14 | if (thisenv == &envs[1]) { 15 | while (1) { 16 | ipc_recv(&who, 0, 0); 17 | cprintf("%x recv from %x\n", id, who); 18 | } 19 | } else { 20 | cprintf("%x loop sending to %x\n", id, envs[1].env_id); 21 | while (1) 22 | ipc_send(envs[1].env_id, 0, 0, 0); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /user/faultalloc.c: -------------------------------------------------------------------------------- 1 | // test user-level fault handler -- alloc pages to fix faults 2 | 3 | #include 4 | 5 | void 6 | handler(struct UTrapframe *utf) 7 | { 8 | int r; 9 | void *addr = (void*)utf->utf_fault_va; 10 | 11 | cprintf("fault %x\n", addr); 12 | if ((r = sys_page_alloc(0, ROUNDDOWN(addr, PGSIZE), 13 | PTE_P|PTE_U|PTE_W)) < 0) 14 | panic("allocating at %x in page fault handler: %e", addr, r); 15 | snprintf((char*) addr, 100, "this string was faulted in at %x", addr); 16 | } 17 | 18 | void 19 | umain(int argc, char **argv) 20 | { 21 | set_pgfault_handler(handler); 22 | cprintf("%s\n", (char*)0xDeadBeef); 23 | cprintf("%s\n", (char*)0xCafeBffe); 24 | } 25 | -------------------------------------------------------------------------------- /user/faultallocbad.c: -------------------------------------------------------------------------------- 1 | // test user-level fault handler -- alloc pages to fix faults 2 | // doesn't work because we sys_cputs instead of cprintf (exercise: why?) 3 | 4 | #include 5 | 6 | void 7 | handler(struct UTrapframe *utf) 8 | { 9 | int r; 10 | void *addr = (void*)utf->utf_fault_va; 11 | 12 | cprintf("fault %x\n", addr); 13 | if ((r = sys_page_alloc(0, ROUNDDOWN(addr, PGSIZE), 14 | PTE_P|PTE_U|PTE_W)) < 0) 15 | panic("allocating at %x in page fault handler: %e", addr, r); 16 | snprintf((char*) addr, 100, "this string was faulted in at %x", addr); 17 | } 18 | 19 | void 20 | umain(int argc, char **argv) 21 | { 22 | set_pgfault_handler(handler); 23 | sys_cputs((char*)0xDEADBEEF, 4); 24 | } 25 | -------------------------------------------------------------------------------- /user/faultbadhandler.c: -------------------------------------------------------------------------------- 1 | // test bad pointer for user-level fault handler 2 | // this is going to fault in the fault handler accessing eip (always!) 3 | // so eventually the kernel kills it (PFM_KILL) because 4 | // we outrun the stack with invocations of the user-level handler 5 | 6 | #include 7 | 8 | void 9 | umain(int argc, char **argv) 10 | { 11 | sys_page_alloc(0, (void*) (UXSTACKTOP - PGSIZE), PTE_P|PTE_U|PTE_W); 12 | sys_env_set_pgfault_upcall(0, (void*) 0xDeadBeef); 13 | *(int*)0 = 0; 14 | } 15 | -------------------------------------------------------------------------------- /user/faultdie.c: -------------------------------------------------------------------------------- 1 | // test user-level fault handler -- just exit when we fault 2 | 3 | #include 4 | 5 | void 6 | handler(struct UTrapframe *utf) 7 | { 8 | void *addr = (void*)utf->utf_fault_va; 9 | uint32_t err = utf->utf_err; 10 | cprintf("i faulted at va %x, err %x\n", addr, err & 7); 11 | sys_env_destroy(sys_getenvid()); 12 | } 13 | 14 | void 15 | umain(int argc, char **argv) 16 | { 17 | set_pgfault_handler(handler); 18 | *(int*)0xDeadBeef = 0; 19 | } 20 | -------------------------------------------------------------------------------- /user/faultevilhandler.c: -------------------------------------------------------------------------------- 1 | // test evil pointer for user-level fault handler 2 | 3 | #include 4 | 5 | void 6 | umain(int argc, char **argv) 7 | { 8 | sys_page_alloc(0, (void*) (UXSTACKTOP - PGSIZE), PTE_P|PTE_U|PTE_W); 9 | sys_env_set_pgfault_upcall(0, (void*) 0xF0100020); 10 | *(int*)0 = 0; 11 | } 12 | -------------------------------------------------------------------------------- /user/faultnostack.c: -------------------------------------------------------------------------------- 1 | // test user fault handler being called with no exception stack mapped 2 | 3 | #include 4 | 5 | void _pgfault_upcall(); 6 | 7 | void 8 | umain(int argc, char **argv) 9 | { 10 | sys_env_set_pgfault_upcall(0, (void*) _pgfault_upcall); 11 | *(int*)0 = 0; 12 | } 13 | -------------------------------------------------------------------------------- /user/faultread.c: -------------------------------------------------------------------------------- 1 | // buggy program - faults with a read from location zero 2 | 3 | #include 4 | 5 | void 6 | umain (int argc, char **argv) 7 | { 8 | cprintf ("I read %08x from location 0!\n", *(unsigned *) 0); 9 | } 10 | -------------------------------------------------------------------------------- /user/faultreadkernel.c: -------------------------------------------------------------------------------- 1 | // buggy program - faults with a read from kernel space 2 | 3 | #include 4 | 5 | void 6 | umain (int argc, char **argv) 7 | { 8 | cprintf ("I read %08x from location 0xf0100000!\n", 9 | *(unsigned *) 0xf0100000); 10 | } 11 | -------------------------------------------------------------------------------- /user/faultwrite.c: -------------------------------------------------------------------------------- 1 | // buggy program - faults with a write to location zero 2 | 3 | #include 4 | 5 | void 6 | umain (int argc, char **argv) 7 | { 8 | *(unsigned *) 0 = 0; 9 | } 10 | -------------------------------------------------------------------------------- /user/faultwritekernel.c: -------------------------------------------------------------------------------- 1 | // buggy program - faults with a write to a kernel location 2 | 3 | #include 4 | 5 | void 6 | umain (int argc, char **argv) 7 | { 8 | *(unsigned *) 0xf0100000 = 0; 9 | } 10 | -------------------------------------------------------------------------------- /user/forktree.c: -------------------------------------------------------------------------------- 1 | // Fork a binary tree of processes and display their structure. 2 | 3 | #include 4 | 5 | #define DEPTH 3 6 | 7 | void forktree(const char *cur); 8 | 9 | void 10 | forkchild(const char *cur, char branch) 11 | { 12 | char nxt[DEPTH+1]; 13 | 14 | if (strlen(cur) >= DEPTH) 15 | return; 16 | 17 | snprintf(nxt, DEPTH+1, "%s%c", cur, branch); 18 | if (fork() == 0) { 19 | forktree(nxt); 20 | exit(); 21 | } 22 | } 23 | 24 | void 25 | forktree(const char *cur) 26 | { 27 | cprintf("%04x: I am '%s'\n", sys_getenvid(), cur); 28 | 29 | forkchild(cur, '0'); 30 | forkchild(cur, '1'); 31 | } 32 | 33 | void 34 | umain(int argc, char **argv) 35 | { 36 | forktree(""); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /user/hello.c: -------------------------------------------------------------------------------- 1 | // hello, world 2 | #include 3 | 4 | void 5 | umain (int argc, char **argv) 6 | { 7 | cprintf ("hello, world\n"); 8 | cprintf ("i am environment %08x\n", thisenv->env_id); 9 | } 10 | -------------------------------------------------------------------------------- /user/idle.c: -------------------------------------------------------------------------------- 1 | // idle loop 2 | 3 | #include 4 | #include 5 | 6 | void 7 | umain(int argc, char **argv) 8 | { 9 | binaryname = "idle"; 10 | 11 | // Loop forever, simply trying to yield to a different environment. 12 | // Instead of busy-waiting like this, 13 | // a better way would be to use the processor's HLT instruction 14 | // to cause the processor to stop executing until the next interrupt - 15 | // doing so allows the processor to conserve power more effectively. 16 | while (1) { 17 | sys_yield(); 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /user/pingpong.c: -------------------------------------------------------------------------------- 1 | // Ping-pong a counter between two processes. 2 | // Only need to start one of these -- splits into two with fork. 3 | 4 | #include 5 | 6 | void 7 | umain(int argc, char **argv) 8 | { 9 | envid_t who; 10 | 11 | if ((who = fork()) != 0) { 12 | // get the ball rolling 13 | cprintf("send 0 from %x to %x\n", sys_getenvid(), who); 14 | ipc_send(who, 0, 0, 0); 15 | } 16 | 17 | while (1) { 18 | uint32_t i = ipc_recv(&who, 0, 0); 19 | cprintf("%x got %d from %x\n", sys_getenvid(), i, who); 20 | if (i == 10) 21 | return; 22 | i++; 23 | ipc_send(who, i, 0, 0); 24 | if (i == 10) 25 | return; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /user/pingpongs.c: -------------------------------------------------------------------------------- 1 | // Ping-pong a counter between two shared-memory processes. 2 | // Only need to start one of these -- splits into two with sfork. 3 | 4 | #include 5 | 6 | uint32_t val; 7 | 8 | void 9 | umain(int argc, char **argv) 10 | { 11 | envid_t who; 12 | uint32_t i; 13 | 14 | i = 0; 15 | if ((who = sfork()) != 0) { 16 | cprintf("i am %08x; thisenv is %p\n", sys_getenvid(), thisenv); 17 | // get the ball rolling 18 | cprintf("send 0 from %x to %x\n", sys_getenvid(), who); 19 | ipc_send(who, 0, 0, 0); 20 | } 21 | 22 | while (1) { 23 | ipc_recv(&who, 0, 0); 24 | cprintf("%x got %d from %x (thisenv is %p %x)\n", sys_getenvid(), val, who, thisenv, thisenv->env_id); 25 | if (val == 10) 26 | return; 27 | ++val; 28 | ipc_send(who, 0, 0, 0); 29 | if (val == 10) 30 | return; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /user/primes.c: -------------------------------------------------------------------------------- 1 | // Concurrent version of prime sieve of Eratosthenes. 2 | // Invented by Doug McIlroy, inventor of Unix pipes. 3 | // See http://swtch.com/~rsc/thread/. 4 | // The picture halfway down the page and the text surrounding it 5 | // explain what's going on here. 6 | // 7 | // Since NENVS is 1024, we can print 1022 primes before running out. 8 | // The remaining two environments are the integer generator at the bottom 9 | // of main and user/idle. 10 | 11 | #include 12 | 13 | unsigned 14 | primeproc(void) 15 | { 16 | int i, id, p; 17 | envid_t envid; 18 | 19 | // fetch a prime from our left neighbor 20 | top: 21 | p = ipc_recv(&envid, 0, 0); 22 | cprintf("CPU %d: %d ", thisenv->env_cpunum, p); 23 | 24 | // fork a right neighbor to continue the chain 25 | if ((id = fork()) < 0) 26 | panic("fork: %e", id); 27 | if (id == 0) 28 | goto top; 29 | 30 | // filter out multiples of our prime 31 | while (1) { 32 | i = ipc_recv(&envid, 0, 0); 33 | if (i % p) 34 | ipc_send(id, i, 0, 0); 35 | } 36 | } 37 | 38 | void 39 | umain(int argc, char **argv) 40 | { 41 | int i, id; 42 | 43 | // fork the first prime process in the chain 44 | if ((id = fork()) < 0) 45 | panic("fork: %e", id); 46 | if (id == 0) 47 | primeproc(); 48 | 49 | // feed all the integers through 50 | for (i = 2; ; i++) 51 | ipc_send(id, i, 0, 0); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /user/softint.c: -------------------------------------------------------------------------------- 1 | // buggy program - causes an illegal software interrupt 2 | 3 | #include 4 | 5 | void 6 | umain (int argc, char **argv) 7 | { 8 | asm volatile ("int $14"); // page fault 9 | } 10 | -------------------------------------------------------------------------------- /user/spin.c: -------------------------------------------------------------------------------- 1 | // Test preemption by forking off a child process that just spins forever. 2 | // Let it run for a couple time slices, then kill it. 3 | 4 | #include 5 | 6 | void 7 | umain(int argc, char **argv) 8 | { 9 | envid_t env; 10 | 11 | cprintf("I am the parent. Forking the child...\n"); 12 | if ((env = fork()) == 0) { 13 | cprintf("I am the child. Spinning...\n"); 14 | while (1) 15 | /* do nothing */; 16 | } 17 | 18 | cprintf("I am the parent. Running the child...\n"); 19 | sys_yield(); 20 | sys_yield(); 21 | sys_yield(); 22 | sys_yield(); 23 | sys_yield(); 24 | sys_yield(); 25 | sys_yield(); 26 | sys_yield(); 27 | /*Ensure its child to print out "Spinning" statement*/ 28 | sys_yield(); 29 | sys_yield(); 30 | sys_yield(); 31 | sys_yield(); 32 | sys_yield(); 33 | sys_yield(); 34 | sys_yield(); 35 | sys_yield(); 36 | sys_yield(); 37 | sys_yield(); 38 | sys_yield(); 39 | sys_yield(); 40 | 41 | cprintf("I am the parent. Killing the child...\n"); 42 | sys_env_destroy(env); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /user/stresssched.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | volatile int counter; 4 | 5 | void 6 | umain(int argc, char **argv) 7 | { 8 | int i, j; 9 | int seen; 10 | envid_t parent = sys_getenvid(); 11 | 12 | // Fork several environments 13 | for (i = 0; i < 20; i++) 14 | if (fork() == 0) 15 | break; 16 | if (i == 20) { 17 | sys_yield(); 18 | return; 19 | } 20 | 21 | // Wait for the parent to finish forking 22 | while (envs[ENVX(parent)].env_status != ENV_FREE) 23 | asm volatile("pause"); 24 | 25 | // Check that one environment doesn't run on two CPUs at once 26 | for (i = 0; i < 10; i++) { 27 | sys_yield(); 28 | for (j = 0; j < 10000; j++) 29 | counter++; 30 | } 31 | 32 | if (counter != 10*10000) 33 | panic("ran on two CPUs at once (counter is %d)", counter); 34 | 35 | // Check that we see environments running on different CPUs 36 | cprintf("[%08x] stresssched on CPU %d\n", thisenv->env_id, thisenv->env_cpunum); 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /user/testbss.c: -------------------------------------------------------------------------------- 1 | // test reads and writes to a large bss 2 | 3 | #include 4 | 5 | #define ARRAYSIZE (1024*1024) 6 | 7 | uint32_t bigarray[ARRAYSIZE]; 8 | 9 | void 10 | umain (int argc, char **argv) 11 | { 12 | int i; 13 | 14 | cprintf ("Making sure bss works right...\n"); 15 | for (i = 0; i < ARRAYSIZE; i++) 16 | if (bigarray[i] != 0) 17 | panic ("bigarray[%d] isn't cleared!\n", i); 18 | for (i = 0; i < ARRAYSIZE; i++) 19 | bigarray[i] = i; 20 | for (i = 0; i < ARRAYSIZE; i++) 21 | if (bigarray[i] != i) 22 | panic ("bigarray[%d] didn't hold its value!\n", i); 23 | 24 | cprintf ("Yes, good. Now doing a wild write off the end...\n"); 25 | bigarray[ARRAYSIZE + 1024] = 0; 26 | panic ("SHOULD HAVE TRAPPED!!!"); 27 | } 28 | -------------------------------------------------------------------------------- /user/user.ld: -------------------------------------------------------------------------------- 1 | /* Simple linker script for JOS user-level programs. 2 | See the GNU ld 'info' manual ("info ld") to learn the syntax. */ 3 | 4 | OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") 5 | OUTPUT_ARCH(i386) 6 | ENTRY(_start) 7 | 8 | SECTIONS 9 | { 10 | /* Load programs at this address: "." means the current address */ 11 | . = 0x800020; 12 | 13 | .text : { 14 | *(.text .stub .text.* .gnu.linkonce.t.*) 15 | } 16 | 17 | PROVIDE(etext = .); /* Define the 'etext' symbol to this value */ 18 | 19 | .rodata : { 20 | *(.rodata .rodata.* .gnu.linkonce.r.*) 21 | } 22 | 23 | /* Adjust the address for the data segment to the next page */ 24 | . = ALIGN(0x1000); 25 | 26 | .data : { 27 | *(.data) 28 | } 29 | 30 | PROVIDE(edata = .); 31 | 32 | .bss : { 33 | *(.bss) 34 | } 35 | 36 | PROVIDE(end = .); 37 | 38 | 39 | /* Place debugging symbols so that they can be found by 40 | * the kernel debugger. 41 | * Specifically, the four words at 0x200000 mark the beginning of 42 | * the stabs, the end of the stabs, the beginning of the stabs 43 | * string table, and the end of the stabs string table, respectively. 44 | */ 45 | 46 | .stab_info 0x200000 : { 47 | LONG(__STAB_BEGIN__); 48 | LONG(__STAB_END__); 49 | LONG(__STABSTR_BEGIN__); 50 | LONG(__STABSTR_END__); 51 | } 52 | 53 | .stab : { 54 | __STAB_BEGIN__ = DEFINED(__STAB_BEGIN__) ? __STAB_BEGIN__ : .; 55 | *(.stab); 56 | __STAB_END__ = DEFINED(__STAB_END__) ? __STAB_END__ : .; 57 | BYTE(0) /* Force the linker to allocate space 58 | for this section */ 59 | } 60 | 61 | .stabstr : { 62 | __STABSTR_BEGIN__ = DEFINED(__STABSTR_BEGIN__) ? __STABSTR_BEGIN__ : .; 63 | *(.stabstr); 64 | __STABSTR_END__ = DEFINED(__STABSTR_END__) ? __STABSTR_END__ : .; 65 | BYTE(0) /* Force the linker to allocate space 66 | for this section */ 67 | } 68 | 69 | /DISCARD/ : { 70 | *(.eh_frame .note.GNU-stack .comment) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /user/yield.c: -------------------------------------------------------------------------------- 1 | // yield the processor to other environments 2 | 3 | #include 4 | 5 | void 6 | umain(int argc, char **argv) 7 | { 8 | int i; 9 | 10 | cprintf("Hello, I am environment %08x.\n", thisenv->env_id); 11 | for (i = 0; i < 5; i++) { 12 | sys_yield(); 13 | cprintf("Back in environment %08x, iteration %d.\n", 14 | thisenv->env_id, i); 15 | } 16 | cprintf("All done in environment %08x.\n", thisenv->env_id); 17 | } 18 | --------------------------------------------------------------------------------