kernel/keyboard.c

本文深入探讨了键盘输入处理的核心代码实现,包括键盘中断处理、扫描码解析及按键状态跟踪等功能。通过对关键函数的分析,揭示了键盘输入如何被正确识别和响应。

[OHOS ERROR] [55770/81199] ACTION //device/board/hardmony/oriole/kernel:kernel(//build/toolchain/ohos:ohos_clang_arm64) [OHOS ERROR] FAILED: kernel/OBJ/linux-5.15/arch/arm64/boot/Image [OHOS ERROR] /usr/bin/env ../../device/board/hardmony/oriole/kernel/build_kernel.sh ../../kernel/linux/linux-5.15 oriole /home/lsd/sig_oriole5.0.3/ga-sig/repo_code/out/oriole userdebug [OHOS ERROR] begin [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/kernel/linux/linux-5.15 ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole [OHOS ERROR] patching file linux-5.15/common_patch/hdf.patch [OHOS ERROR] patching file drivers/Kconfig [OHOS ERROR] Hunk #1 succeeded at 249 (offset 2 lines). [OHOS ERROR] patching file drivers/Makefile [OHOS ERROR] Hunk #1 succeeded at 195 (offset 1 line). [OHOS ERROR] patching file drivers/power/supply/Kconfig [OHOS ERROR] patching file drivers/power/supply/Makefile [OHOS ERROR] Hunk #1 succeeded at 115 with fuzz 2. [OHOS ERROR] patching file drivers/power/supply/sgm41513-charger.c [OHOS ERROR] patching file include/linux/power/sgm41513_reg.h [OHOS ERROR] patching file arch/arm64/boot/dts/sprd/uis7885-2h10-overlay.dts [OHOS ERROR] patch unexpectedly ends in middle of line [OHOS ERROR] Hunk #7 succeeded at 402 with fuzz 1. [OHOS ERROR] patching file arch/arm64/boot/dts/sprd/uis7885-2h10-overlay.dts [OHOS ERROR] Hunk #1 succeeded at 449 (offset -31 lines). [OHOS ERROR] patching file fs/proc/base.c [OHOS ERROR] patching file include/linux/sched.h [OHOS ERROR] patching file include/linux/sched/frame_rtg.h [OHOS ERROR] patching file include/linux/sched/rtg.h [OHOS ERROR] patching file include/linux/sched/rtg_ctrl.h [OHOS ERROR] patching file init/Kconfig [OHOS ERROR] patching file kernel/sched/Makefile [OHOS ERROR] patching file kernel/sched/core.c [OHOS ERROR] patching file kernel/sched/rtg/Kconfig [OHOS ERROR] patching file kernel/sched/rtg/Makefile [OHOS ERROR] patching file kernel/sched/rtg/frame_rtg.c [OHOS ERROR] patching file kernel/sched/rtg/frame_rtg.h [OHOS ERROR] patching file kernel/sched/rtg/rtg.c [OHOS ERROR] patching file kernel/sched/rtg/rtg.h [OHOS ERROR] patching file kernel/sched/rtg/rtg_ctrl.c [OHOS ERROR] patching file kernel/sched/rtg/rtg_ctrl.h [OHOS ERROR] patching file kernel/sched/sched.h [OHOS ERROR] patching file drivers/base/firmware_loader/main.c [OHOS ERROR] patching file drivers/dma-buf/dma-buf.c [OHOS ERROR] Hunk #1 succeeded at 872 (offset 41 lines). [OHOS ERROR] Hunk #2 succeeded at 957 (offset 41 lines). [OHOS ERROR] patching file drivers/accesstokenid/access_tokenid.c [OHOS ERROR] patching file drivers/staging/hilog/hilog.c [OHOS ERROR] patching file include/linux/mod_devicetable.h [OHOS ERROR] patching file include/uapi/linux/input-event-codes.h [OHOS ERROR] patching file mm/zswapd.c [OHOS ERROR] patching file arch/arm64/kernel/vmlinux.lds.S [OHOS ERROR] patching file drivers/Kconfig [OHOS ERROR] Hunk #1 succeeded at 239 (offset 2 lines). [OHOS ERROR] patching file drivers/Makefile [OHOS ERROR] Hunk #1 succeeded at 191 (offset 4 lines). [OHOS ERROR] patching file drivers/hdf/Makefile [OHOS ERROR] patching file drivers/hid/Makefile [OHOS ERROR] patching file drivers/hid/hid-core.c [OHOS ERROR] patching file drivers/hid/hid-input.c [OHOS ERROR] patching file drivers/input/keyboard/Makefile [OHOS ERROR] patching file drivers/input/misc/Makefile [OHOS ERROR] patching file drivers/input/mousedev.c [OHOS ERROR] patching file drivers/usb/core/notify.c [OHOS ERROR] patching file drivers/usb/dwc3/sprd/gadget.c [OHOS ERROR] Hunk #1 succeeded at 4132 (offset 24 lines). [OHOS ERROR] Hunk #2 succeeded at 4140 (offset 24 lines). [OHOS ERROR] patching file include/linux/hid.h [OHOS ERROR] patching file include/linux/usb.h [OHOS ERROR] /home/lsd/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] kernel_linux_common_modules [OHOS ERROR] checking file code_sign/code_sign_elf.c [OHOS ERROR] Reversed (or previously applied) patch detected! Assume -R? [n] [OHOS ERROR] Apply anyway? [n] [OHOS ERROR] Skipping patch. [OHOS ERROR] 7 out of 7 hunks ignored [OHOS ERROR] checking file code_sign/code_sign_ioctl.c [OHOS ERROR] Reversed (or previously applied) patch detected! Assume -R? [n] [OHOS ERROR] Apply anyway? [n] [OHOS ERROR] Skipping patch. [OHOS ERROR] 1 out of 1 hunk ignored [OHOS ERROR] checking file qos_auth/auth_ctl/qos_ctrl.c [OHOS ERROR] Reversed (or previously applied) patch detected! Assume -R? [n] [OHOS ERROR] Apply anyway? [n] [OHOS ERROR] Skipping patch. [OHOS ERROR] 4 out of 4 hunks ignored [OHOS ERROR] checking file ucollection/unified_collection_driver.c [OHOS ERROR] Reversed (or previously applied) patch detected! Assume -R? [n] [OHOS ERROR] Apply anyway? [n] [OHOS ERROR] Skipping patch. [OHOS ERROR] 1 out of 1 hunk ignored [OHOS ERROR] checking file xpm/core/xpm_security_hooks.c [OHOS ERROR] Reversed (or previously applied) patch detected! Assume -R? [n] [OHOS ERROR] Apply anyway? [n] [OHOS ERROR] Skipping patch. [OHOS ERROR] 2 out of 2 hunks ignored [OHOS ERROR] Patch has already been done [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] create link /home/lsd/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15/drivers/staging/ucollection/ [OHOS ERROR] ~/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] /home/lsd/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/src_tmp/linux-5.15 [OHOS ERROR] kernel TARGET_BUILD_VARIANT is userdebug [OHOS ERROR] make[1]: Entering directory '/home/lsd/sig_oriole5.0.3/ga-sig/repo_code/out/oriole/kernel/OBJ/linux-5.15' [OHOS ERROR] GEN Makefile [OHOS ERROR] HOSTCC scripts/basic/fixdep [OHOS ERROR] HOSTCC scripts/kconfig/conf.o [OHOS ERROR] HOSTCC scripts/kconfig/confdata.o [OHOS ERROR] HOSTCC scripts/kconfig/expr.o [OHOS ERROR] LEX scripts/kconfig/lexer.lex.c [OHOS ERROR] YACC scripts/kconfig/parser.tab.[ch] [OHOS ERROR] HOSTCC scripts/kconfig/lexer.lex.o [OHOS ERROR] scripts/kconfig/lexer.lex.c:2242:20: warning: unused variable 'kconfig_white_list' [-Wunused-variable] [OHOS ERROR] static const char *kconfig_white_list[] = { [OHOS ERROR] ^ [OHOS ERROR] 1 warning generated. [OHOS ERROR] HOSTCC scripts/kconfig/menu.o [OHOS ERROR] HOSTCC scripts/kconfig/parser.tab.o [OHOS ERROR] HOSTCC scripts/kconfig/preprocess.o [OHOS ERROR] HOSTCC scripts/kconfig/symbol.o [OHOS ERROR] HOSTCC scripts/kconfig/util.o [OHOS ERROR] HOSTLD scripts/kconfig/conf [OHOS ERROR] drivers/staging/ucollection/Kconfig:2:warning: ignoring type redefinition of 'UNIFIED_COLLECTION' from 'bool' to 'tristate' [OHOS ERROR] drivers/hdf/khdf/model/audio/Kconfig:96:warning: ignoring type redefinition of 'DRM_DW_HDMI_I2S_AUDIO' from 'tristate' to 'bool' [OHOS ERROR] drivers/tzdriver/core/Kconfig:2:warning: ignoring unsupported character ' [OHOS ERROR] ' [OHOS ERROR] drivers/tzdriver/core/Kconfig:3:warning: ignoring unsupported character ' [OHOS ERROR] ' [OHOS ERROR] drivers/tzdriver/core/Kconfig:4:warning: ignoring unsupported character '
最新发布
07-25
# Makefile for GeekOS kernel, userspace, and tools # Copyright (c) 2004,2005 David H. Hovemeyer <daveho@cs.umd.edu> # $Revision: 1.45 $ # This is free software. You are permitted to use, # redistribute, and modify it as specified in the file "COPYING". # Required software to build GeekOS: # - GNU Make (http://www.gnu.org/software/make) # - gcc 2.95.2 generating code for target (i386/ELF) and host platforms # - nasm (http://nasm.sourceforge.net) # - Perl5, AWK (any version), egrep # # Cygwin (http://cygwin.com) may be used to build GeekOS. # Make sure that gcc, binutils, nasm, and perl are installed. # NOTES: # - This makefile has been written carefully to work correctly # with the -j (parallel make) option. I regularly use "make -j 2" # to speed the build process on 2 processor systems. PROJECT_ROOT := .. VPATH := $(PROJECT_ROOT)/src # Figure out if we're compiling with cygwin, http://cygwin.com SYSTEM_NAME := $(shell uname -s) ifeq ($(findstring CYGWIN,$(SYSTEM_NAME)),CYGWIN) SYM_PFX := _ EXTRA_C_OPTS := -DNEED_UNDERSCORE -DGNU_WIN32 EXTRA_NASM_OPTS := -DNEED_UNDERSCORE NON_ELF_SYSTEM := yes EXTRA_CC_USER_OPTS := -Dmain=geekos_main endif # ---------------------------------------------------------------------- # Configuration - # Various options specifying how GeekOS should be built, # what source files to build, which user programs to build, # etc. This is generally the only section of the makefile # that will need to be modified. # ---------------------------------------------------------------------- # List of targets to build by default. # These targets encompass everything needed to boot # and run GeekOS. ALL_TARGETS := fd.img # Kernel source files KERNEL_C_SRCS := idt.c int.c trap.c irq.c io.c \ keyboard.c screen.c timer.c \ mem.c crc32.c \ gdt.c tss.c segment.c \ bget.c malloc.c \ synch.c kthread.c \ main.c # Kernel object files built from C source files KERNEL_C_OBJS := $(KERNEL_C_SRCS:%.c=geekos/%.o) # Kernel assembly files KERNEL_ASM_SRCS := lowlevel.asm # Kernel object files build from assembler source files KERNEL_ASM_OBJS := \ $(KERNEL_ASM_SRCS:%.asm=geekos/%.o) # All kernel object files KERNEL_OBJS := $(KERNEL_C_OBJS) \ $(KERNEL_ASM_OBJS) # Common library source files. # This library is linked into both the kernel and user programs. # It provides string functions and generic printf()-style # formatted output. COMMON_C_SRCS := fmtout.c string.c memmove.c # Common library object files. COMMON_C_OBJS := $(COMMON_C_SRCS:%.c=common/%.o) # Base address of kernel KERNEL_BASE_ADDR := 0x00010000 # Kernel entry point function KERNEL_ENTRY = $(SYM_PFX)Main # ---------------------------------------------------------------------- # Tools - # This section defines programs that are used to build GeekOS. # ---------------------------------------------------------------------- # Uncomment if cross compiling #TARGET_CC_PREFIX := i386-elf- # Target C compiler. gcc 2.95.2 or later should work. TARGET_CC := $(TARGET_CC_PREFIX)gcc # Host C compiler. This is used to compile programs to execute on # the host platform, not the target (x86) platform. On x86/ELF # systems, such as Linux and FreeBSD, it can generally be the same # as the target C compiler. HOST_CC := gcc # Target linker. GNU ld is probably to only one that will work. TARGET_LD := $(TARGET_CC_PREFIX)ld # Target archiver TARGET_AR := $(TARGET_CC_PREFIX)ar # Target ranlib TARGET_RANLIB := $(TARGET_CC_PREFIX)ranlib # Target nm TARGET_NM := $(TARGET_CC_PREFIX)nm # Target objcopy TARGET_OBJCOPY := $(TARGET_CC_PREFIX)objcopy # Nasm (http://nasm.sourceforge.net) NASM := nasm # Tool to build PFAT filesystem images. BUILDFAT := tools/builtFat.exe # Perl5 or later PERL := perl # Pad a file so its size is a multiple of some unit (i.e., sector size) PAD := $(PERL) $(PROJECT_ROOT)/scripts/pad # Create a file filled with zeroes. ZEROFILE := $(PERL) $(PROJECT_ROOT)/scripts/zerofile # Calculate size of file in sectors NUMSECS := $(PERL) $(PROJECT_ROOT)/scripts/numsecs # ---------------------------------------------------------------------- # Definitions - # Options passed to the tools. # ---------------------------------------------------------------------- # Flags used for all C source files GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) CC_GENERAL_OPTS := $(GENERAL_OPTS) -Werror # Flags used for kernel C source files CC_KERNEL_OPTS := -g -DGEEKOS -I$(PROJECT_ROOT)/include # Flags user for kernel assembly files NASM_KERNEL_OPTS := -I$(PROJECT_ROOT)/src/geekos/ -f elf $(EXTRA_NASM_OPTS) # Flags used for common library and libc source files CC_USER_OPTS := -I$(PROJECT_ROOT)/include -I$(PROJECT_ROOT)/include/libc \ $(EXTRA_CC_USER_OPTS) # Flags passed to objcopy program (strip unnecessary sections from kernel.exe) OBJCOPY_FLAGS := -R .dynamic -R .note -R .comment # ---------------------------------------------------------------------- # Rules - # Describes how to compile the source files. # ---------------------------------------------------------------------- # Compilation of kernel C source files geekos/%.o : geekos/%.c $(TARGET_CC) -c $(CC_GENERAL_OPTS) $(CC_KERNEL_OPTS) $< -o geekos/$*.o # Compilation of kernel assembly source files geekos/%.o : geekos/%.asm $(NASM) $(NASM_KERNEL_OPTS) $< -o geekos/$*.o geekos/%.o : geekos/%.S $(TARGET_CC) -c $(CC_GENERAL_OPTS) $(CC_KERNEL_OPTS) $< -o geekos/$*.o # Compilation of common library C source files common/%.o : common/%.c $(TARGET_CC) -c $(CC_GENERAL_OPTS) $(CC_USER_OPTS) $< -o common/$*.o # ---------------------------------------------------------------------- # Targets - # Specifies files to be built # ---------------------------------------------------------------------- # Default target - see definition of ALL_TARGETS in Configuration section all : $(ALL_TARGETS) # Standard floppy image - just boots the kernel fd.img : geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin cat geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin > $@ # Floppy boot sector (first stage boot loader). geekos/fd_boot.bin : geekos/setup.bin geekos/kernel.bin $(PROJECT_ROOT)/src/geekos/fd_boot.asm $(NASM) -f bin \ -I$(PROJECT_ROOT)/src/geekos/ \ -DNUM_SETUP_SECTORS=`$(NUMSECS) geekos/setup.bin` \ -DNUM_KERN_SECTORS=`$(NUMSECS) geekos/kernel.bin` \ $(PROJECT_ROOT)/src/geekos/fd_boot.asm \ -o $@ # Setup program (second stage boot loader). geekos/setup.bin : geekos/kernel.exe $(PROJECT_ROOT)/src/geekos/setup.asm $(NASM) -f bin \ -I$(PROJECT_ROOT)/src/geekos/ \ -DENTRY_POINT=0x`egrep 'Main$$' geekos/kernel.syms |awk '{print $$1}'` \ $(PROJECT_ROOT)/src/geekos/setup.asm \ -o $@ $(PAD) $@ 512 # Loadable (flat) kernel image. geekos/kernel.bin : geekos/kernel.exe $(TARGET_OBJCOPY) $(OBJCOPY_FLAGS) -S -O binary geekos/kernel.exe geekos/kernel.bin $(PAD) $@ 512 # The kernel executable and symbol map. geekos/kernel.exe : $(KERNEL_OBJS) $(COMMON_C_OBJS) $(TARGET_LD) -o geekos/kernel.exe -Ttext $(KERNEL_BASE_ADDR) -e $(KERNEL_ENTRY) \ $(KERNEL_OBJS) $(COMMON_C_OBJS) $(TARGET_NM) geekos/kernel.exe > geekos/kernel.syms # Clean build directories of generated files clean : for d in geekos common libc user tools; do \ (cd $$d && rm -f *); \ done # Build header file dependencies, so source files are recompiled when # header files they depend on are modified. depend : $(GENERATED_LIBC_SRCS) $(TARGET_CC) -M $(CC_GENERAL_OPTS) $(CC_KERNEL_OPTS) \ $(KERNEL_C_SRCS:%.c=$(PROJECT_ROOT)/src/geekos/%.c) \ | $(PERL) -n -e 's,^(\S),geekos/$$1,;print' \ > depend.mak $(TARGET_CC) -M $(CC_GENERAL_OPTS) $(CC_USER_OPTS) \ $(COMMON_C_SRCS:%.c=$(PROJECT_ROOT)/src/common/%.c) \ | $(PERL) -n -e 's,^(\S),common/$$1,;print' \ >> depend.mak # By default, there are no header file dependencies. depend.mak : touch $@ include depend.mak 在哪里修改
05-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值