├── 2440_irq_project ├── Makefile ├── boot.c ├── boot.lds ├── init.c ├── interrupt.c ├── s3c24xx.h └── start.S ├── 2440_irq_stdio_project ├── 2440_irq_project.si4project │ ├── 2440_irq_project.SearchResults │ ├── 2440_irq_project.bookmarks.xml │ ├── 2440_irq_project.sip_sym │ ├── 2440_irq_project.sip_xab │ ├── 2440_irq_project.sip_xad │ ├── 2440_irq_project.sip_xc │ ├── 2440_irq_project.sip_xf │ ├── 2440_irq_project.sip_xm │ ├── 2440_irq_project.sip_xr │ ├── 2440_irq_project.sip_xsb │ ├── 2440_irq_project.sip_xsd │ ├── 2440_irq_project.siproj │ ├── 2440_irq_project.siproj_settings.xml │ ├── 2440_irq_project.siwork │ ├── Backup │ │ ├── boot(7808).c │ │ ├── boot(7831).c │ │ ├── boot(867).c │ │ ├── init(1417).c │ │ ├── init(4797).c │ │ ├── init(5517).c │ │ ├── init(7227).c │ │ ├── interrupt(1630).c │ │ ├── interrupt(2579).c │ │ ├── interrupt(481).c │ │ ├── interrupt(5278).c │ │ ├── interrupt(5609).c │ │ ├── interrupt(6324).c │ │ ├── interrupt(6360).c │ │ ├── interrupt(6518).c │ │ ├── interrupt(696).c │ │ ├── interrupt(7792).c │ │ ├── s3c24xx(4120).h │ │ ├── s3c24xx(7172).h │ │ ├── start(2961).S │ │ └── start(5459).S │ └── cache │ │ └── parse │ │ ├── boot.c.sisc │ │ ├── init.c.sisc │ │ ├── interrupt.c.sisc │ │ └── s3c24xx.h.sisc ├── Makefile ├── head.S ├── head.S.bak ├── include │ ├── ctype.h │ ├── gcclib.h │ ├── kernel.h │ ├── stdio.h │ ├── system.h │ └── types.h ├── init.c ├── init.c.bak ├── interrupt.c ├── interrupt.c.bak ├── lib │ ├── Makefile │ ├── ctype.c │ ├── div64.S │ ├── div64.h │ ├── lib1funcs.S │ ├── muldi3.c │ ├── printf.c │ ├── printf.h │ ├── string.c │ ├── string.h │ ├── vsprintf.c │ └── vsprintf.h ├── main.c ├── main.c.bak ├── nand.c ├── s3c24xx.h ├── serial.c ├── serial.h └── stdio.lds ├── LCD ├── LCD.IAB ├── LCD.IAD ├── LCD.IMB ├── LCD.IMD ├── LCD.PFI ├── LCD.PO ├── LCD.PR ├── LCD.PRI ├── LCD.PS ├── LCD.WK3 └── lcd_3.5_4.3 │ ├── Makefile │ ├── framebuffer.c │ ├── framebuffer.h │ ├── head.S │ ├── include │ ├── ctype.h │ ├── gcclib.h │ ├── kernel.h │ ├── stdio.h │ ├── string.h │ ├── system.h │ └── types.h │ ├── init.c │ ├── interrupt.c │ ├── interrupt.h │ ├── lcd.bin │ ├── lcd.lds │ ├── lcddrv.c │ ├── lcddrv.h │ ├── lcdlib.c │ ├── lcdlib.h │ ├── lib │ ├── Makefile │ ├── ctype.c │ ├── div64.S │ ├── div64.h │ ├── lib1funcs.S │ ├── libc.a │ ├── muldi3.c │ ├── printf.c │ ├── printf.h │ ├── string.c │ ├── vsprintf.c │ └── vsprintf.h │ ├── main.c │ ├── nand.c │ ├── s3c24xx.h │ ├── serial.c │ └── serial.h ├── MiniGUI ├── libminigui-1.6.10.tar.gz ├── mg-samples-1.6.10.tar.gz ├── minigui-res-1.6.10.tar.gz └── tslib-1.4.tar.gz ├── PCB_Ruler ├── PCB_Ruler │ ├── 0:初稿 │ │ ├── PCB_Ruler_v1.0.PCB │ │ └── PCB_Ruler设计初稿.docx │ ├── 1:初稿修改后打样 │ │ ├── PCB_Ruler_v1.1.PcbDoc │ │ ├── 反.png │ │ └── 正.png │ ├── 2:初稿打样反馈意见 │ │ ├── PCB_Ruler_v2.0.PcbDoc │ │ └── 反馈意见.docx │ ├── 3:再次修改打样 │ │ ├── PCB_Ruler_v2.1.1.PcbDoc │ │ ├── PCB_Ruler_v2.1.2.PcbDoc │ │ ├── PCB_Ruler_v2.1.PcbDoc │ │ ├── 反.jpg │ │ └── 正.jpg │ └── 4:终稿 │ │ └── PCB_Ruler_v3.0.PcbDoc ├── PCB_Ruler构想.docx ├── PCB最后效果图 │ ├── 信息.jpg │ ├── 局部1.jpg │ ├── 局部11.jpg │ ├── 局部2.jpg │ ├── 局部3.jpg │ ├── 局部4.jpg │ ├── 局部5.jpg │ ├── 正面.jpg │ └── 背面.jpg └── README.md ├── android ├── 01_硬件访问服务 │ ├── APP │ │ ├── LED_no hardware │ │ │ ├── MainActivity.java │ │ │ └── activity_main.xml │ │ ├── LED_use_JNI │ │ │ ├── hardlibrary │ │ │ │ └── HardControl.java │ │ │ └── led │ │ │ │ └── MainActivity.java │ │ └── LED_use_SystemServer │ │ │ ├── use_JAR │ │ │ └── MainActivity.java │ │ │ └── use_Reflect │ │ │ └── MainActivity.java │ └── SYS │ │ ├── use_JNI │ │ ├── hardcontrol.c │ │ └── libhardcontrol.so │ │ └── use_SystemServer │ │ ├── 1_linux_drv │ │ ├── Makefile │ │ └── leds_drv.c │ │ ├── 2_hal │ │ ├── Android.mk │ │ ├── led_hal.c │ │ └── led_hal.h │ │ ├── 3_jni │ │ ├── Android.mk │ │ └── com_android_server_LedService.cpp │ │ ├── 4_system │ │ ├── SystemServer.java │ │ └── onload.cpp │ │ ├── 5_service │ │ └── LedService.java │ │ └── 6_aidl │ │ ├── ILedService.aidl │ │ └── ILedService.java └── 02_灯光系统 │ ├── app │ ├── brightness │ │ ├── AndroidManifest.xml │ │ ├── layout │ │ │ └── activity_main.xml │ │ └── lights │ │ │ └── MainActivity.java │ └── notification │ │ ├── layout │ │ └── activity_main.xml │ │ └── lights │ │ └── MainActivity.java │ ├── driver │ └── leds │ │ └── tiny4412_leds.c │ └── hal │ ├── Android.mk │ └── lights.c ├── atomic ├── Makefile └── atomic_drv.c ├── auto_usb └── usb.c ├── boot_to_int ├── Makefile ├── boot.c ├── boot.lds ├── init.c ├── interrupt.c ├── s3c24xx.h └── start.S ├── build_env ├── arm-linux-gcc-4.4.3.tar.gz ├── install-devel-packages-for-16.sh └── install-devel-packages.sh ├── c++_learn ├── 01th_oop │ ├── person1 │ ├── person1.c │ ├── person2 │ └── person2.cpp ├── 02th_access │ ├── person │ └── person.cpp ├── 03th_structure │ ├── Makefile │ ├── dog.cpp │ ├── dog.h │ ├── main.cpp │ ├── person.cpp │ └── person.h ├── 04th_overload │ ├── main │ └── main.cpp ├── 05th_pointer │ ├── main │ └── main.cpp ├── 06th_constructor │ ├── person │ └── person.cpp ├── 07th_static │ ├── person │ └── person.cpp ├── 08th_friend │ ├── point │ └── point.cpp ├── 09th_operator │ ├── point │ └── point.cpp ├── 10th_inheritance │ ├── father_son │ └── father_son.cpp ├── 11th_multi_inheritance │ ├── sofabed │ └── sofabed.cpp ├── 12th_constructor_queue │ ├── CompanySofabed │ └── CompanySofabed.cpp ├── 13th_polymorphism │ ├── human │ └── human.cpp ├── 14th_convert │ ├── human │ └── human.cpp ├── 15th_abstract │ ├── American.cpp │ ├── American.h │ ├── American.o │ ├── Chinese.cpp │ ├── Chinese.h │ ├── Chinese.o │ ├── Human │ ├── Human.cpp │ ├── Human.h │ ├── Human.o │ ├── Makefile │ ├── libHuman.so │ ├── main.cpp │ └── main.o ├── 16th_function_template │ ├── compare │ └── compare.cpp ├── 17th_class_template │ ├── car │ └── car.cpp ├── 18th_exception │ ├── exception │ └── exception.cpp ├── 19th_smartpointer │ ├── RefBase.h │ ├── StrongPointer.h │ ├── TypeHelpers.h │ ├── androidsmartpointer │ ├── androidsmartpointer.cpp │ ├── smartpointer │ └── smartpointer.cpp ├── 20th_strongpointer_weekpointer │ ├── Makefile │ ├── RefBase.cpp │ ├── RefBase.o │ ├── include │ │ ├── LightPointeRefBase.h │ │ ├── StrongPointer.h │ │ ├── TypeHelpers.h │ │ ├── cutils │ │ │ ├── android_reboot.h │ │ │ ├── aref.h │ │ │ ├── ashmem.h │ │ │ ├── atomic-arm.h │ │ │ ├── atomic-arm64.h │ │ │ ├── atomic-inline.h │ │ │ ├── atomic-mips.h │ │ │ ├── atomic-mips64.h │ │ │ ├── atomic-x86.h │ │ │ ├── atomic-x86_64.h │ │ │ ├── atomic.h │ │ │ ├── bitops.h │ │ │ ├── compiler.h │ │ │ ├── config_utils.h │ │ │ ├── cpu_info.h │ │ │ ├── debugger.h │ │ │ ├── dir_hash.h │ │ │ ├── fs.h │ │ │ ├── hashmap.h │ │ │ ├── iosched_policy.h │ │ │ ├── jstring.h │ │ │ ├── klog.h │ │ │ ├── list.h │ │ │ ├── log.h │ │ │ ├── memory.h │ │ │ ├── misc.h │ │ │ ├── multiuser.h │ │ │ ├── native_handle.h │ │ │ ├── open_memstream.h │ │ │ ├── partition_utils.h │ │ │ ├── process_name.h │ │ │ ├── properties.h │ │ │ ├── qtaguid.h │ │ │ ├── record_stream.h │ │ │ ├── sched_policy.h │ │ │ ├── sockets.h │ │ │ ├── str_parms.h │ │ │ ├── threads.h │ │ │ ├── trace.h │ │ │ └── uevent.h │ │ └── utils │ │ │ ├── AndroidThreads.h │ │ │ ├── Atomic.h │ │ │ ├── BasicHashtable.h │ │ │ ├── BitSet.h │ │ │ ├── BlobCache.h │ │ │ ├── ByteOrder.h │ │ │ ├── CallStack.h │ │ │ ├── Compat.h │ │ │ ├── Condition.h │ │ │ ├── Debug.h │ │ │ ├── Endian.h │ │ │ ├── Errors.h │ │ │ ├── FileMap.h │ │ │ ├── Flattenable.h │ │ │ ├── Functor.h │ │ │ ├── JenkinsHash.h │ │ │ ├── KeyedVector.h │ │ │ ├── LinearAllocator.h │ │ │ ├── LinearTransform.h │ │ │ ├── List.h │ │ │ ├── Log.h │ │ │ ├── Looper.h │ │ │ ├── LruCache.h │ │ │ ├── Mutex.h │ │ │ ├── NativeHandle.h │ │ │ ├── Printer.h │ │ │ ├── ProcessCallStack.h │ │ │ ├── PropertyMap.h │ │ │ ├── RWLock.h │ │ │ ├── RefBase.h │ │ │ ├── SharedBuffer.h │ │ │ ├── Singleton.h │ │ │ ├── SortedVector.h │ │ │ ├── StopWatch.h │ │ │ ├── String16.h │ │ │ ├── String8.h │ │ │ ├── StrongPointer.h │ │ │ ├── SystemClock.h │ │ │ ├── Thread.h │ │ │ ├── ThreadDefs.h │ │ │ ├── Timers.h │ │ │ ├── Tokenizer.h │ │ │ ├── Trace.h │ │ │ ├── TypeHelpers.h │ │ │ ├── Unicode.h │ │ │ ├── Vector.h │ │ │ ├── VectorImpl.h │ │ │ ├── ashmem.h │ │ │ ├── misc.h │ │ │ └── threads.h │ ├── pointer │ ├── pointer.cpp │ └── pointer.o ├── 21th_singleton │ ├── singleton │ └── singleton.cpp └── 22th_bridge_mode │ ├── installos1 │ ├── installos1.cpp │ ├── installos2 │ └── installos2.cpp ├── drivers_jz2440_3.4.2 ├── 10th_lcd │ ├── Makefile │ └── lcd.c ├── 11th_ts │ ├── Makefile │ ├── s3c_ts.c │ └── tslib-1.4.tar.gz ├── 12th_usb │ ├── Makefile │ └── usbmouse_as_key.c ├── 13th_ramblock │ ├── Makefile │ └── ramblock.c ├── 14th_nand │ ├── Makefile │ ├── mtd-utils-05.07.23.tar.bz2 │ └── s3c_nand.c ├── 15th_nor │ ├── Makefile │ └── s3c_nor.c ├── 16th_virt_net │ ├── Makefile │ └── virt_net.c ├── 17th_dm9000c │ ├── Makefile │ ├── dm9000.h │ └── dm9dev9000c.c ├── 26th_debug_regeditor │ ├── first_drv │ │ ├── Makefile │ │ ├── first_drv.c │ │ ├── firstdrvtest │ │ └── firstdrvtest.c │ ├── ker_rw.c │ └── regeditor.c ├── 7th_buttons_all │ ├── Makefile │ ├── buttons.c │ ├── buttons_test │ └── buttons_test.c ├── 8th_buttons_input │ ├── Makefile │ └── buttons.c ├── fb_test │ ├── Makefile │ ├── fb.h │ └── fb_test.c ├── fifth_drv │ ├── Makefile │ ├── fifth_drv.c │ ├── fifthdrvtest │ └── fifthdrvtest.c ├── first_drv │ ├── Makefile │ ├── first_drv.c │ ├── firstdrvtest │ └── firstdrvtest.c ├── forth_drv │ ├── Makefile │ ├── forth_drv.c │ ├── forthdrvtest │ └── forthdrvtest.c ├── second_drv │ ├── Makefile │ ├── second_drv.c │ ├── seconddrvtest │ └── seconddrvtest.c ├── sixth_drv │ ├── Makefile │ ├── sixth_drv.c │ ├── sixthdrvtest │ └── sixthdrvtest.c ├── third_drv │ ├── Makefile │ ├── third_drv.c │ ├── thirddrvtest │ └── thirddrvtest.c ├── 移植所有驱动到3.4.2内核去.TXT └── 韦东山linux第二期视屏文档整理.docx ├── hceng ├── learn_bus │ ├── Makefile │ └── kobject_test.c └── led │ ├── Makefile │ ├── led_dev.c │ ├── led_drv.c │ └── led_test.c ├── imx6ull └── hardware │ ├── ddr │ ├── Makefile │ ├── README │ ├── ddr.c │ ├── imx6ul.bin │ ├── imximage.cfg.cfgtmp │ ├── led.c │ ├── mkimage │ ├── myimx6ul.bin │ └── start.S │ ├── led │ ├── Makefile │ ├── README │ ├── imximage.cfg.cfgtmp │ ├── led.c │ ├── mkimage │ ├── myled.bin │ └── start.S │ └── uart │ ├── Makefile │ ├── imx6ul.bin │ ├── imx6ul.dis │ ├── imx6ul.lds │ ├── imx6ul_elf │ ├── imximage.cfg.cfgtmp │ ├── led.c │ ├── led.h │ ├── led.o │ ├── main.c │ ├── main.o │ ├── mkimage │ ├── myimx6ul.bin │ ├── printf.c │ ├── printf.h │ ├── printf.o │ ├── start.S │ ├── start.o │ ├── uart.c │ ├── uart.h │ └── uart.o ├── io ├── day1 │ ├── 1-fopen.c │ ├── 2-fopen_max.c │ ├── 3-fgetc.c │ ├── 4-cat.c │ ├── 5-cp.c │ ├── 6-line.c │ ├── 7-fgets.c │ ├── 8-fgets_cp.c │ ├── 9-fread_fwrite.c │ ├── IO-day1.txt │ ├── cat │ ├── cp │ ├── cp_hceng.txt │ ├── fgetc │ ├── fgets │ ├── fgets_cp │ ├── fopen_max │ ├── fread │ ├── hceng.txt │ ├── u_cat │ ├── u_cp │ └── u_line ├── day2 │ ├── IO-day2-1.txt │ ├── IO-day2.txt │ ├── cp │ ├── cp.c │ ├── cp.txt │ ├── hceng.txt │ ├── hceng_time │ ├── hceng_time.c │ ├── hole │ ├── hole.c │ ├── hole.txt │ ├── open │ ├── open.c │ ├── opendir │ ├── opendir.c │ ├── read_write │ ├── read_write.c │ ├── rewind │ ├── rewind.c │ ├── stat.c │ ├── test.txt │ ├── text │ ├── time │ └── time.c ├── day3 │ ├── PROCESS-day1.txt │ ├── dynamic │ │ ├── add.c │ │ ├── add.o │ │ ├── libmythirdmath.so │ │ ├── main │ │ ├── main.c │ │ ├── sub.c │ │ └── sub.o │ ├── exit │ ├── exit.c │ ├── fork │ ├── fork.c │ ├── fork1 │ ├── fork2 │ ├── fork_1.c │ ├── fork_2.c │ ├── static │ │ ├── add.c │ │ ├── add.o │ │ ├── libmysecmath.a │ │ ├── main │ │ ├── main.c │ │ ├── sub.c │ │ └── sub.o │ └── while.c ├── day4 │ ├── PROCESS-day2.txt │ ├── dameon │ ├── dameon.c │ ├── exec │ ├── exec.c │ ├── pthread │ ├── pthread.c │ ├── pthread_1 │ ├── pthread_1.c │ ├── pthread_mutex │ ├── pthread_mutex.c │ ├── pthread_syns │ └── pthread_syns.c ├── day5 │ ├── PROCESS-day3.txt │ ├── alarm │ ├── alarm.c │ ├── cp.txt │ ├── kill │ ├── kill.c │ ├── mkfifo_r │ ├── mkfifo_r.c │ ├── mkfifo_w │ ├── mkfifo_w.c │ ├── pipe │ ├── pipe.c │ ├── pthread │ │ ├── manpages-posix-dev_2.16-1_all.deb │ │ └── manpages-posix_2.16-1_all.deb │ ├── pthread_1.c │ ├── raise │ ├── raise.c │ ├── signal │ ├── signal.c │ └── while.c └── day6 │ ├── PROCESS-day4.txt │ ├── driver │ ├── driver.c │ ├── ftok │ ├── ftok.c │ ├── msg │ ├── msg_r │ ├── msg_r.c │ ├── msg_w │ └── msg_w.c │ ├── sem_r.c │ ├── sem_w.c │ ├── shm_r │ ├── shm_r.c │ ├── shm_w │ └── shm_w.c ├── java_learn ├── 01th_hello │ ├── Hello.class │ └── Hello.java ├── 02th_var │ ├── Var.class │ └── Var.java ├── 03th_method │ ├── Method.class │ └── Method.java ├── 04th_param │ ├── Param.class │ └── Param.java ├── 05th_oop │ ├── Oop.class │ ├── Oop.java │ └── Person.class ├── 06th_enc │ ├── Enc.class │ ├── Enc.java │ └── Person.class ├── 07th_extends │ ├── A.class │ ├── Abstract.class │ ├── Abstract.java │ ├── B.class │ ├── Ext.class │ ├── Ext.java │ ├── Father.class │ ├── Interface.class │ ├── Interface.java │ ├── Limit.class │ ├── Limit.java │ ├── Person.class │ ├── Son.class │ └── Student.class ├── 08th_cnv │ ├── Cnv.class │ ├── Cnv.java │ ├── Daughter.class │ ├── Father.class │ └── Son.class ├── 09th_exception │ ├── Div.class │ └── Div.java ├── 10th_package │ ├── Pack.class │ ├── Pack.java │ ├── hceng │ │ ├── Math.java │ │ └── Permission.java │ ├── jack │ │ ├── Math.java │ │ └── TestAccess.java │ └── pack.jar ├── 11th_Inner │ ├── A.class │ ├── Inner$1.class │ ├── Inner.class │ ├── Inner.java │ ├── MyInterface.class │ ├── OutClass$InnerClass.class │ ├── OutClass$InnerClass1.class │ ├── OutClass$InnerClass2.class │ ├── OutClass.class │ └── PrintInterface.class ├── 12th_jni │ ├── 1 │ │ ├── Jni.class │ │ ├── Jni.h │ │ ├── Jni.java │ │ ├── libnative.so │ │ └── native.c │ ├── 2 │ │ ├── Jni.class │ │ ├── Jni.h │ │ ├── Jni.java │ │ ├── libnative.so │ │ └── native.c │ └── 3 │ │ ├── Hello.class │ │ ├── Hello.java │ │ ├── caller │ │ └── caller.c ├── 13th_generics │ ├── Generics.class │ ├── Generics.java │ ├── Person1.class │ ├── Person2.class │ ├── Person3.class │ ├── Studen2.class │ ├── Student1.class │ ├── Student2.class │ ├── Student3.class │ ├── Student4.class │ └── Student5.class └── 14th_reflect │ ├── Person.java │ ├── Reflect.java │ ├── Student.java │ ├── hceng │ ├── Person.class │ └── Reflect.class │ └── jack │ ├── Person.class │ └── Student.class ├── kobject_test ├── Makefile ├── kobject_app.c └── kobject_test.c ├── lock ├── Makefile ├── lock_drv.c └── lock_test.c ├── markdown_here ├── markdownhere.css └── my_markdownhere.css ├── my_bootloader ├── Makefile ├── boot.c ├── boot.lds ├── init.c ├── setup.h └── start.S ├── nano_pi_drv ├── 1th_hello │ ├── .hello.ko.cmd │ ├── .hello.mod.o.cmd │ ├── .hello.o.cmd │ ├── .tmp_versions │ │ └── hello.mod │ ├── Makefile │ ├── Module.symvers │ ├── hello.c │ ├── hello.ko │ ├── hello.mod.c │ ├── hello.mod.o │ ├── hello.o │ └── modules.order ├── 2th_led │ ├── .led_drv.ko.cmd │ ├── .led_drv.mod.o.cmd │ ├── .led_drv.o.cmd │ ├── .tmp_versions │ │ └── led_drv.mod │ ├── Makefile │ ├── Module.symvers │ ├── led_drv.c │ ├── led_drv.ko │ ├── led_drv.mod.c │ ├── led_drv.mod.o │ ├── led_drv.o │ ├── led_test │ ├── led_test.c │ └── modules.order ├── 3th_button │ ├── Makefile │ ├── Module.symvers │ ├── button_drv.c │ ├── button_drv.ko │ ├── button_drv.mod.c │ ├── button_drv.mod.o │ ├── button_drv.o │ ├── button_led_test.c │ ├── button_test.c │ └── modules.order ├── 4th_irq │ ├── Makefile │ ├── button_irq_drv.c │ ├── button_irq_drv.o │ ├── button_irq_test.c │ ├── button_led_irq_test.c │ └── led_drv.ko ├── 5th_poll │ ├── Makefile │ ├── button_irq_poll_drv.c │ ├── button_irq_poll_drv.ko │ ├── button_led_irq_poll_test │ ├── button_led_irq_poll_test.c │ ├── button_led_irq_test │ └── led_drv.ko ├── 6th_fasync │ ├── Makefile │ ├── button_irq_fasync_drv.c │ ├── button_irq_fasync_drv.ko │ ├── button_led_irq_fasync_test │ ├── button_led_irq_fasync_test.c │ ├── button_led_irq_poll_test │ ├── button_led_irq_test │ └── led_drv.ko └── 7th_sem │ ├── Makefile │ ├── button_irq_fasync_sem_drv.c │ ├── button_irq_fasync_sem_drv.ko │ ├── button_led_irq_fasync_test │ ├── button_led_irq_fasync_test_sem.c │ ├── button_led_irq_poll_test │ ├── button_led_irq_test │ └── led_drv.ko ├── push.bat ├── rk3288 └── hardware │ ├── 1_led │ ├── Readme │ ├── boot_merger │ ├── code │ │ ├── Makefile │ │ ├── led.c │ │ ├── led.h │ │ ├── main.c │ │ ├── rk3288.lds │ │ └── start.S │ ├── rk3288.ini │ └── tool │ │ ├── 32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin │ │ └── rk32xxusbplug.bin │ ├── 2_uart │ ├── Readme │ ├── boot_merger │ ├── code │ │ ├── Makefile │ │ ├── led.c │ │ ├── led.h │ │ ├── main.c │ │ ├── printf.c │ │ ├── printf.h │ │ ├── rk3288.lds │ │ ├── start.S │ │ ├── uart.c │ │ └── uart.h │ ├── rk3288.ini │ └── tool │ │ ├── 32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin │ │ └── rk32xxusbplug.bin │ ├── 3_irq │ ├── Readme │ ├── boot_merger │ ├── code │ │ ├── Makefile │ │ ├── int.c │ │ ├── int.h │ │ ├── key.c │ │ ├── key.h │ │ ├── led.c │ │ ├── led.h │ │ ├── main.c │ │ ├── printf.c │ │ ├── printf.h │ │ ├── rk3288.lds │ │ ├── start.S │ │ ├── timer.c │ │ ├── timer.h │ │ ├── uart.c │ │ └── uart.h │ ├── rk3288.ini │ └── tool │ │ ├── 32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin │ │ └── rk32xxusbplug.bin │ └── 4_lcd │ ├── lvds │ ├── Makefile │ ├── int.c │ ├── int.h │ ├── key.c │ ├── key.h │ ├── lcd.c │ ├── lcd.h │ ├── led.c │ ├── led.h │ ├── main.c │ ├── printf.c │ ├── printf.h │ ├── rk3288.lds │ ├── start.S │ ├── timer.c │ ├── timer.h │ ├── uart.c │ ├── uart.h │ └── 分析.txt │ └── mipi │ ├── Makefile │ ├── int.c │ ├── int.h │ ├── key.c │ ├── key.h │ ├── lcd.c │ ├── lcd.h │ ├── led.c │ ├── led.h │ ├── main.c │ ├── printf.c │ ├── printf.h │ ├── rk3288.lds │ ├── start.S │ ├── timer.c │ ├── timer.h │ ├── uart.c │ ├── uart.h │ └── 分析.txt ├── semaphore ├── Makefile ├── semaphore_drv.c └── semaphore_test.c ├── shell ├── hceng_am437x_create_MLO.sh ├── hceng_am437x_debug.sh ├── install_for_14.sh ├── install_for_16.04.sh └── setup_ubuntu_host_env.sh ├── ss ├── APP │ └── Shadowrocket(freeluffy).ipa ├── BBR │ └── bbr.sh ├── README.md ├── SS │ ├── SS_Linux.sh │ └── shadowsocks-all.sh └── SSPort │ ├── SSPort.py │ ├── autostart.sh │ └── config.ini ├── tcp_udp ├── tcp │ ├── tcp_client.c │ └── tcp_server.c └── udp │ ├── udp_client.c │ └── udp_server.c ├── tiny4412 ├── 01_backlight_drv │ ├── app.c │ ├── backlight_drv.c │ └── exynos4412-tiny4412.dts ├── 02_lcd_drv │ ├── Makefile │ ├── lcd_drv.c │ └── libjpeg_new │ │ ├── jpg_rgb │ │ ├── jpg_rgb.c │ │ └── libjpeg-turbo-1.5.3.tar.gz ├── 03_touchscreen │ ├── Makefile │ ├── app.c │ ├── edt-ft5x06.c │ ├── edt-ft5x06.txt │ └── touchscreen.txt ├── 04_power_management │ ├── regulator │ │ ├── regulator_process.txt │ │ ├── use_dts │ │ │ ├── Makefile │ │ │ ├── exynos4412-tiny4412.dts │ │ │ ├── lcd_drv.c │ │ │ └── regulator.c │ │ └── use_machine │ │ │ ├── Makefile │ │ │ ├── backlight_drv.c │ │ │ ├── lcd_drv.c │ │ │ ├── machine.c │ │ │ └── regulator.c │ ├── runtime │ │ ├── Makefile │ │ ├── backlight_drv.c │ │ ├── cq.jpg │ │ ├── jpg_rgb_noset │ │ ├── jpg_rgb_noset.c │ │ ├── lcd_drv.c │ │ └── runtime_process.txt │ └── suspend │ │ ├── Makefile │ │ ├── app │ │ ├── backlight_drv.c │ │ ├── button_interrupt.c │ │ ├── exynos4412-tiny4412.dts │ │ ├── lcd_drv.c │ │ ├── supend_process.txt │ │ └── usb4604.c ├── 06_irda │ ├── Makefile │ ├── app │ ├── app.c │ ├── exynos4412-tiny4412.dts │ ├── gpio-ir-recv.c │ └── rc-hceng-nec.c ├── 07_vivid │ ├── kernel_viivd │ │ ├── v4l2_core │ │ │ ├── v4l2-dv-timings.ko │ │ │ ├── videobuf-core.ko │ │ │ └── videobuf-vmalloc.ko │ │ └── vivid_drv │ │ │ ├── Makefile │ │ │ ├── vivid-core.c │ │ │ ├── vivid-core.h │ │ │ ├── vivid-ctrls.c │ │ │ ├── vivid-ctrls.h │ │ │ ├── vivid-kthread-cap.c │ │ │ ├── vivid-kthread-cap.h │ │ │ ├── vivid-kthread-out.c │ │ │ ├── vivid-kthread-out.h │ │ │ ├── vivid-osd.c │ │ │ ├── vivid-osd.h │ │ │ ├── vivid-radio-common.c │ │ │ ├── vivid-radio-common.h │ │ │ ├── vivid-radio-rx.c │ │ │ ├── vivid-radio-rx.h │ │ │ ├── vivid-radio-tx.c │ │ │ ├── vivid-radio-tx.h │ │ │ ├── vivid-rds-gen.c │ │ │ ├── vivid-rds-gen.h │ │ │ ├── vivid-sdr-cap.c │ │ │ ├── vivid-sdr-cap.h │ │ │ ├── vivid-tpg-colors.c │ │ │ ├── vivid-tpg-colors.h │ │ │ ├── vivid-tpg.c │ │ │ ├── vivid-tpg.h │ │ │ ├── vivid-vbi-cap.c │ │ │ ├── vivid-vbi-cap.h │ │ │ ├── vivid-vbi-gen.c │ │ │ ├── vivid-vbi-gen.h │ │ │ ├── vivid-vbi-out.c │ │ │ ├── vivid-vbi-out.h │ │ │ ├── vivid-vid-cap.c │ │ │ ├── vivid-vid-cap.h │ │ │ ├── vivid-vid-common.c │ │ │ ├── vivid-vid-common.h │ │ │ ├── vivid-vid-out.c │ │ │ ├── vivid-vid-out.h │ │ │ └── xawtv.log │ ├── my_vivid │ │ ├── Makefile │ │ ├── fillbuf.c │ │ └── my_vivid.c │ └── vivid_core分析.txt ├── 08_uvc │ ├── USB设备描述符.txt │ ├── kernel_uvc │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── uvc.patch │ │ ├── uvc_ctrl.c │ │ ├── uvc_debugfs.c │ │ ├── uvc_driver.c │ │ ├── uvc_entity.c │ │ ├── uvc_isight.c │ │ ├── uvc_queue.c │ │ ├── uvc_status.c │ │ ├── uvc_v4l2.c │ │ ├── uvc_video.c │ │ └── uvcvideo.h │ ├── my_uvc │ │ ├── Makefile │ │ ├── my_uvc.c │ │ └── uvcvideo.h │ └── uvc分析.txt ├── 09_video2lcd │ ├── app_code │ │ ├── Makefile │ │ ├── Makefile.build │ │ ├── convert │ │ │ ├── Makefile │ │ │ ├── color.c │ │ │ ├── color.h │ │ │ ├── convert_manager.c │ │ │ ├── jdatasrc-tj.c │ │ │ ├── mjpeg2rgb.c │ │ │ ├── rgb2rgb.c │ │ │ └── yuv2rgb.c │ │ ├── display │ │ │ ├── Makefile │ │ │ ├── disp_manager.c │ │ │ └── lcd.c │ │ ├── include │ │ │ ├── config.h │ │ │ ├── convert_manager.h │ │ │ ├── disp_manager.h │ │ │ ├── jconfig.h │ │ │ ├── jerror.h │ │ │ ├── jinclude.h │ │ │ ├── jmorecfg.h │ │ │ ├── jpeglib.h │ │ │ ├── process.h │ │ │ └── video_manager.h │ │ ├── main.c │ │ ├── process │ │ │ ├── Makefile │ │ │ ├── merge.c │ │ │ └── zoom.c │ │ └── video │ │ │ ├── Makefile │ │ │ ├── v4l2.c │ │ │ └── video_manager.c │ └── driver │ │ ├── Kconfig │ │ ├── Makefile │ │ └── hceng_drv │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── backlight_drv.c │ │ ├── lcd_drv.c │ │ ├── uvc_drv.c │ │ └── uvcvideo.h └── 10_usb_wifi │ ├── buildroot │ └── .config │ ├── kernel │ └── .config │ └── rootfs │ ├── etc │ ├── dhcpcd.conf │ ├── hostapd.conf │ ├── mdev.conf │ └── wpa_supplicant.conf │ ├── lib │ └── firmware │ │ └── rt2870.bin │ └── sbin │ ├── auto_dhcp.sh │ ├── auto_wifi.sh │ └── auto_wifi_ap.sh └── vim └── .vimrc /2440_irq_project/Makefile: -------------------------------------------------------------------------------- 1 | CC = arm-linux-gcc 2 | LD = arm-linux-ld 3 | AR = arm-linux-ar 4 | OBJCOPY = arm-linux-objcopy 5 | OBJDUMP = arm-linux-objdump 6 | 7 | CFLAGS := -Wall -O2 8 | CPPFLAGS := -nostdinc -nostdlib -fno-builtin 9 | 10 | objs := start.o init.o interrupt.o boot.o 11 | 12 | boot.bin: $(objs) 13 | ${LD} -Tboot.lds -o boot.elf $^ 14 | ${OBJCOPY} -O binary -S boot.elf $@ 15 | ${OBJDUMP} -D -m arm boot.elf > boot.dis 16 | 17 | %.o:%.c 18 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 19 | 20 | %.o:%.S 21 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 22 | 23 | clean: 24 | rm -f *.o *.bin *.elf *.dis 25 | 26 | -------------------------------------------------------------------------------- /2440_irq_project/boot.c: -------------------------------------------------------------------------------- 1 | #include "s3c24xx.h" 2 | 3 | int main(void) 4 | { 5 | uart0_init(); 6 | 7 | puts("ok.\n\r"); 8 | 9 | 10 | while(1); 11 | 12 | puts("erro.\n\r"); 13 | 14 | return -1; 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /2440_irq_project/boot.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x33f80000; 3 | .text : { *(.text) } 4 | 5 | . = ALIGN(4); 6 | .rodata : {*(.rodata*)} 7 | 8 | . = ALIGN(4); 9 | .data : { *(.data) } 10 | . = ALIGN(4); 11 | 12 | __bss_start = .; 13 | .bss : { *(.bss) *(COMMON) } 14 | __bss_end = .; 15 | } 16 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.SearchResults: -------------------------------------------------------------------------------- 1 | ---- UTRSTAT0 Matches (2 in 2 files) ---- 2 | putc in init.c : while (!(UTRSTAT0 & TXD0READY)); 3 | s3c24xx.h line 38 : #define UTRSTAT0 (*(volatile unsigned long *)0x50000010) 4 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.bookmarks.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_sym: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_sym -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xab -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xad: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xad -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xc -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xf -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xm: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xr -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xsb -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.sip_xsd -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.siproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.siproj -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.siproj_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.siwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/2440_irq_project.siwork -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/Backup/boot(7808).c: -------------------------------------------------------------------------------- 1 | #include "s3c24xx.h" 2 | 3 | int main(void) 4 | { 5 | uart0_init(); 6 | 7 | puts("ok.\n\r"); 8 | 9 | while(1) 10 | { 11 | 12 | } 13 | return -1; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/Backup/boot(7831).c: -------------------------------------------------------------------------------- 1 | #include "s3c24xx.h" 2 | 3 | int main(void) 4 | { 5 | uart0_init(); 6 | 7 | puts("ok.\n\r"); 8 | 9 | puts("hceng.\n\r"); 10 | 11 | while(1) 12 | { 13 | 14 | } 15 | return -1; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/Backup/boot(867).c: -------------------------------------------------------------------------------- 1 |  2 | extern void uart0_init(void); 3 | extern void puts(char *str); 4 | extern void puthex(unsigned int val); 5 | 6 | int strlen(char *str) 7 | { 8 | int i = 0; 9 | while (str[i]) 10 | { 11 | i++; 12 | } 13 | return i; 14 | } 15 | 16 | void strcpy(char *dest, char *src) 17 | { 18 | while ((*dest++ = *src++) != '\0'); 19 | } 20 | 21 | int main(void) 22 | { 23 | /* 0. 帮内核设置串口: 内核启动的开始部分会从串口打印一些信息,但是内核一开始没有初始化串口 */ 24 | uart0_init(); 25 | while(1) 26 | { 27 | /* 1. 从NAND FLASH里把内核读入内存 */ 28 | puts("ok.\n\r"); 29 | } 30 | return -1; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/Backup/interrupt(1630).c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/Backup/interrupt(1630).c -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/boot.c.sisc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/boot.c.sisc -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/init.c.sisc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/init.c.sisc -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/interrupt.c.sisc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/interrupt.c.sisc -------------------------------------------------------------------------------- /2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/s3c24xx.h.sisc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/2440_irq_project.si4project/cache/parse/s3c24xx.h.sisc -------------------------------------------------------------------------------- /2440_irq_stdio_project/include/kernel.h: -------------------------------------------------------------------------------- 1 | #define INT_MAX ((int)(~0U>>1)) 2 | #define INT_MIN (-INT_MAX - 1) 3 | #define UINT_MAX (~0U) 4 | #define LONG_MAX ((long)(~0UL>>1)) 5 | #define LONG_MIN (-LONG_MAX - 1) 6 | #define ULONG_MAX (~0UL) 7 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/include/types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TPYES_H 3 | #define _TPYES_H 4 | 5 | #ifndef NULL 6 | #define NULL 0 7 | #endif 8 | 9 | #ifndef _SIZE_T 10 | #define _SIZE_T 11 | typedef unsigned int size_t; 12 | #endif /* _SIZE_T */ 13 | 14 | 15 | #endif /* _TPYES_H */ 16 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/interrupt.c.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/interrupt.c.bak -------------------------------------------------------------------------------- /2440_irq_stdio_project/lib/Makefile: -------------------------------------------------------------------------------- 1 | objs := div64.o lib1funcs.o ctype.o muldi3.o printf.o string.o vsprintf.o 2 | $(info echo "lib_makefile_objs="$(objs)) 3 | libc.a: $(objs) 4 | ${AR} -r -o $@ $^ 5 | 6 | %.o:%.c 7 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 8 | 9 | %.o:%.S 10 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 11 | 12 | clean: 13 | rm -f libc.a *.o 14 | 15 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/lib/printf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PRINTF_H 3 | #define _PRINTF_H 4 | 5 | int printf(const char *fmt, ...); 6 | int scanf(const char * fmt, ...); 7 | 8 | #endif /* _PRINTF_H */ 9 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include "stdio.h" 3 | #include "serial.h" 4 | 5 | 6 | int main(void) 7 | { 8 | int i = 0; 9 | 10 | char str[100]; 11 | 12 | uart0_init( ); //波特率57600,8N1(8个数据位,无校验位,1个停止位) 13 | 14 | //printf("\n\rStart : \n\r"); 15 | printf("\n\rok!! \n\r"); 16 | 17 | while(1) 18 | { 19 | //printf("Enter a value : \n\r"); 20 | //scanf("%s", str); 21 | //sscanf(str,"%d", &i); 22 | //printf("print interger : %d, 0x%x\n\r", i, i); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/main.c.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/main.c.bak -------------------------------------------------------------------------------- /2440_irq_stdio_project/nand.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/nand.c -------------------------------------------------------------------------------- /2440_irq_stdio_project/serial.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/2440_irq_stdio_project/serial.c -------------------------------------------------------------------------------- /2440_irq_stdio_project/serial.h: -------------------------------------------------------------------------------- 1 | 2 | #define SERIAL_ECHO 3 | 4 | void init_uart(void); 5 | void putc(unsigned char c); 6 | unsigned char getc(void); 7 | -------------------------------------------------------------------------------- /2440_irq_stdio_project/stdio.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x00000000; 3 | .init : AT(0){ head.o init.o nand.o} 4 | . = 0x30000000; 5 | .text : AT(4096) { *(.text) } 6 | .rodata ALIGN(4) : AT((LOADADDR(.text)+SIZEOF(.text)+3)&~(0x03)) {*(.rodata*)} 7 | .data ALIGN(4) : AT((LOADADDR(.rodata)+SIZEOF(.rodata)+3)&~(0x03)) { *(.data) } 8 | __bss_start = .; 9 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 10 | __bss_end = .; 11 | } 12 | -------------------------------------------------------------------------------- /LCD/LCD.IAB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.IAB -------------------------------------------------------------------------------- /LCD/LCD.IAD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.IAD -------------------------------------------------------------------------------- /LCD/LCD.IMB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.IMB -------------------------------------------------------------------------------- /LCD/LCD.IMD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.IMD -------------------------------------------------------------------------------- /LCD/LCD.PFI: -------------------------------------------------------------------------------- 1 | D 2 | @ -------------------------------------------------------------------------------- /LCD/LCD.PO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.PO -------------------------------------------------------------------------------- /LCD/LCD.PR: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.PR -------------------------------------------------------------------------------- /LCD/LCD.PRI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.PRI -------------------------------------------------------------------------------- /LCD/LCD.PS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.PS -------------------------------------------------------------------------------- /LCD/LCD.WK3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/LCD.WK3 -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/framebuffer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/framebuffer.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/framebuffer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/framebuffer.h -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/head.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/head.S -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/include/kernel.h: -------------------------------------------------------------------------------- 1 | #define INT_MAX ((int)(~0U>>1)) 2 | #define INT_MIN (-INT_MAX - 1) 3 | #define UINT_MAX (~0U) 4 | #define LONG_MAX ((long)(~0UL>>1)) 5 | #define LONG_MIN (-LONG_MAX - 1) 6 | #define ULONG_MAX (~0UL) 7 | -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/include/types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TPYES_H 3 | #define _TPYES_H 4 | 5 | #ifndef NULL 6 | #define NULL 0 7 | #endif 8 | 9 | #ifndef UINT32 10 | #define UINT32 unsigned int 11 | #endif 12 | 13 | #ifndef UINT16 14 | #define UINT16 unsigned short 15 | #endif 16 | 17 | #ifndef UINT8 18 | #define UINT8 unsigned char 19 | #endif 20 | 21 | #ifndef _SIZE_T 22 | #define _SIZE_T 23 | typedef unsigned int size_t; 24 | #endif /* _SIZE_T */ 25 | 26 | 27 | #endif /* _TPYES_H */ 28 | -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/init.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/init.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/interrupt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/interrupt.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/interrupt.h: -------------------------------------------------------------------------------- 1 | void EINT_Handle(); 2 | -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lcd.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/lcd.bin -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lcd.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x00000000; 3 | .init : AT(0){ head.o init.o nand.o} 4 | . = 0x30000000; 5 | .text : AT(4096) { *(.text) } 6 | .rodata ALIGN(4) : AT((LOADADDR(.text)+SIZEOF(.text)+3)&~(0x03)) {*(.rodata*)} 7 | .data ALIGN(4) : AT((LOADADDR(.rodata)+SIZEOF(.rodata)+3)&~(0x03)) { *(.data) } 8 | __bss_start = .; 9 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 10 | __bss_end = .; 11 | } 12 | -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lcddrv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/lcddrv.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lcddrv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/lcddrv.h -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lcdlib.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/lcdlib.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lcdlib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/lcdlib.h -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lib/Makefile: -------------------------------------------------------------------------------- 1 | objs := div64.o lib1funcs.o ctype.o muldi3.o printf.o string.o vsprintf.o 2 | 3 | libc.a: $(objs) 4 | ${AR} -r -o $@ $^ 5 | 6 | %.o:%.c 7 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 8 | 9 | %.o:%.S 10 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 11 | 12 | clean: 13 | rm -f libc.a *.o 14 | 15 | -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lib/libc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/lib/libc.a -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/lib/printf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PRINTF_H 3 | #define _PRINTF_H 4 | 5 | int printf(const char *fmt, ...); 6 | int scanf(const char * fmt, ...); 7 | 8 | #endif /* _PRINTF_H */ 9 | -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/main.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/nand.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/nand.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/serial.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/LCD/lcd_3.5_4.3/serial.c -------------------------------------------------------------------------------- /LCD/lcd_3.5_4.3/serial.h: -------------------------------------------------------------------------------- 1 | void uart0_init(void); 2 | void putc(unsigned char c); 3 | unsigned char getc(void); 4 | int isDigit(unsigned char c); 5 | int isLetter(unsigned char c); 6 | -------------------------------------------------------------------------------- /MiniGUI/libminigui-1.6.10.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/MiniGUI/libminigui-1.6.10.tar.gz -------------------------------------------------------------------------------- /MiniGUI/mg-samples-1.6.10.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/MiniGUI/mg-samples-1.6.10.tar.gz -------------------------------------------------------------------------------- /MiniGUI/minigui-res-1.6.10.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/MiniGUI/minigui-res-1.6.10.tar.gz -------------------------------------------------------------------------------- /MiniGUI/tslib-1.4.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/MiniGUI/tslib-1.4.tar.gz -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/0:初稿/PCB_Ruler_v1.0.PCB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/0:初稿/PCB_Ruler_v1.0.PCB -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/0:初稿/PCB_Ruler设计初稿.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/0:初稿/PCB_Ruler设计初稿.docx -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/1:初稿修改后打样/PCB_Ruler_v1.1.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/1:初稿修改后打样/PCB_Ruler_v1.1.PcbDoc -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/1:初稿修改后打样/反.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/1:初稿修改后打样/反.png -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/1:初稿修改后打样/正.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/1:初稿修改后打样/正.png -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/2:初稿打样反馈意见/PCB_Ruler_v2.0.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/2:初稿打样反馈意见/PCB_Ruler_v2.0.PcbDoc -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/2:初稿打样反馈意见/反馈意见.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/2:初稿打样反馈意见/反馈意见.docx -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/3:再次修改打样/PCB_Ruler_v2.1.1.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/3:再次修改打样/PCB_Ruler_v2.1.1.PcbDoc -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/3:再次修改打样/PCB_Ruler_v2.1.2.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/3:再次修改打样/PCB_Ruler_v2.1.2.PcbDoc -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/3:再次修改打样/PCB_Ruler_v2.1.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/3:再次修改打样/PCB_Ruler_v2.1.PcbDoc -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/3:再次修改打样/反.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/3:再次修改打样/反.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/3:再次修改打样/正.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/3:再次修改打样/正.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler/4:终稿/PCB_Ruler_v3.0.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler/4:终稿/PCB_Ruler_v3.0.PcbDoc -------------------------------------------------------------------------------- /PCB_Ruler/PCB_Ruler构想.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB_Ruler构想.docx -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/信息.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/信息.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/局部1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/局部1.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/局部11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/局部11.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/局部2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/局部2.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/局部3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/局部3.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/局部4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/局部4.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/局部5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/局部5.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/正面.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/正面.jpg -------------------------------------------------------------------------------- /PCB_Ruler/PCB最后效果图/背面.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/PCB_Ruler/PCB最后效果图/背面.jpg -------------------------------------------------------------------------------- /android/01_硬件访问服务/APP/LED_use_JNI/hardlibrary/HardControl.java: -------------------------------------------------------------------------------- 1 | package cn.hceng.hardlibrary; 2 | 3 | public class HardControl { 4 | //1.load 5 | static { 6 | try { 7 | System.loadLibrary("hardcontrol"); //Call libhardcontrol.so from C. 8 | } catch (Exception e) { 9 | e.printStackTrace(); 10 | } 11 | } 12 | //2.Function declaration 13 | public static native int ledCtrl(int number, int status); 14 | public static native int ledOpen(); 15 | public static native void ledClose(); 16 | } -------------------------------------------------------------------------------- /android/01_硬件访问服务/SYS/use_JNI/libhardcontrol.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/android/01_硬件访问服务/SYS/use_JNI/libhardcontrol.so -------------------------------------------------------------------------------- /android/01_硬件访问服务/SYS/use_SystemServer/2_hal/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := led.default 6 | 7 | LOCAL_MODULE_RELATIVE_PATH := hw 8 | LOCAL_C_INCLUDES := hardware/libhardware 9 | LOCAL_SRC_FILES := led_hal.c 10 | LOCAL_SHARED_LIBRARIES := liblog 11 | LOCAL_MODULE_TAGS := eng 12 | 13 | include $(BUILD_SHARED_LIBRARY) 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /android/01_硬件访问服务/SYS/use_SystemServer/2_hal/led_hal.h: -------------------------------------------------------------------------------- 1 | #ifndef ANDROID_LED_INTERFACE_H 2 | #define ANDROID_LED_INTERFACE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | __BEGIN_DECLS 11 | 12 | struct led_device_t { 13 | struct hw_device_t common; 14 | 15 | int (*led_open) (struct led_device_t* dev); 16 | int (*led_ctrl) (struct led_device_t* dev, int number, int status); 17 | }; 18 | 19 | __END_DECLS 20 | 21 | #endif -------------------------------------------------------------------------------- /android/01_硬件访问服务/SYS/use_SystemServer/5_service/LedService.java: -------------------------------------------------------------------------------- 1 | package com.android.server; 2 | import android.os.ILedService; 3 | 4 | public class LedService extends ILedService.Stub { 5 | private static final String TAG = "ILedService"; 6 | 7 | //Call native c function to access hardware 8 | public int ledCtrl(int number, int status) throws android.os.RemoteException 9 | { 10 | return native_ledCtrl(number, status); 11 | } 12 | 13 | public LedService() { 14 | native_ledOpen(); 15 | } 16 | 17 | //Function declaration 18 | public static native int native_ledCtrl(int number, int status); 19 | public static native int native_ledOpen(); 20 | public static native void native_ledClose(); 21 | } -------------------------------------------------------------------------------- /android/01_硬件访问服务/SYS/use_SystemServer/6_aidl/ILedService.aidl: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | interface ILedService { 4 | int ledCtrl(int number, int status); 5 | } 6 | -------------------------------------------------------------------------------- /android/02_灯光系统/hal/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | # LOCAL_MODULE := lights.default 6 | LOCAL_MODULE := lights.tiny4412 7 | 8 | LOCAL_MODULE_RELATIVE_PATH := hw 9 | LOCAL_C_INCLUDES := hardware/libhardware 10 | LOCAL_SRC_FILES := lights.c 11 | LOCAL_SHARED_LIBRARIES := liblog 12 | LOCAL_MODULE_TAGS := eng 13 | 14 | include $(BUILD_SHARED_LIBRARY) 15 | -------------------------------------------------------------------------------- /atomic/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/hceng/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += atomic_drv.o 11 | 12 | -------------------------------------------------------------------------------- /boot_to_int/Makefile: -------------------------------------------------------------------------------- 1 | CC = arm-linux-gcc 2 | LD = arm-linux-ld 3 | AR = arm-linux-ar 4 | OBJCOPY = arm-linux-objcopy 5 | OBJDUMP = arm-linux-objdump 6 | 7 | CFLAGS := -Wall -O2 8 | CPPFLAGS := -nostdinc -nostdlib -fno-builtin 9 | 10 | objs := start.o init.o interrupt.o boot.o 11 | 12 | boot.bin: $(objs) 13 | ${LD} -Tboot.lds -o boot.elf $^ 14 | ${OBJCOPY} -O binary -S boot.elf $@ 15 | ${OBJDUMP} -D -m arm boot.elf > boot.dis 16 | 17 | %.o:%.c 18 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 19 | 20 | %.o:%.S 21 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 22 | 23 | clean: 24 | rm -f *.o *.bin *.elf *.dis 25 | 26 | -------------------------------------------------------------------------------- /boot_to_int/boot.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/boot_to_int/boot.c -------------------------------------------------------------------------------- /boot_to_int/boot.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x33f80000; 3 | .text : { *(.text) } 4 | 5 | . = ALIGN(4); 6 | .rodata : {*(.rodata*)} 7 | 8 | . = ALIGN(4); 9 | .data : { *(.data) } 10 | . = ALIGN(4); 11 | 12 | __bss_start = .; 13 | .bss : { *(.bss) *(COMMON) } 14 | __bss_end = .; 15 | } 16 | -------------------------------------------------------------------------------- /boot_to_int/interrupt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/boot_to_int/interrupt.c -------------------------------------------------------------------------------- /boot_to_int/start.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/boot_to_int/start.S -------------------------------------------------------------------------------- /build_env/arm-linux-gcc-4.4.3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/build_env/arm-linux-gcc-4.4.3.tar.gz -------------------------------------------------------------------------------- /c++_learn/01th_oop/person1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/01th_oop/person1 -------------------------------------------------------------------------------- /c++_learn/01th_oop/person1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct person { 4 | char *name; 5 | int age; 6 | char *work; 7 | 8 | void (*printf_info)(struct person *per); //函数指针 9 | }; 10 | 11 | void printf_info(struct person *per) 12 | { 13 | printf("name = %6s, age = %2d, work = %s\n", per->name, per->age, per->work); 14 | } 15 | 16 | int main(int argc, char **argv) 17 | { 18 | struct person person[] = { 19 | {"hceng", 23, "Embedded engineer", printf_info}, 20 | {"jack", 21, "Graphic Designer", printf_info} 21 | }; 22 | 23 | person[0].printf_info(&person[0]); 24 | person[1].printf_info(&person[1]); 25 | 26 | return 0; 27 | } -------------------------------------------------------------------------------- /c++_learn/01th_oop/person2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/01th_oop/person2 -------------------------------------------------------------------------------- /c++_learn/01th_oop/person2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //struct person { 4 | class person { 5 | public: 6 | char const *name; //warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 7 | int age; 8 | char const *work; 9 | 10 | void printf_info(void) 11 | { 12 | printf("name = %6s, age = %2d, work = %s\n", name, age, work); //函数实现直接写在了里面,且可访问数据 13 | } 14 | }; 15 | 16 | int main(int argc, char **argv) 17 | { 18 | struct person person[] = { 19 | {"hceng", 23, "Embedded engineer"}, 20 | {"jack", 21, "Graphic Designer"} 21 | }; 22 | 23 | person[0].printf_info(); 24 | person[1].printf_info(); 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /c++_learn/02th_access/person: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/02th_access/person -------------------------------------------------------------------------------- /c++_learn/03th_structure/Makefile: -------------------------------------------------------------------------------- 1 | 2 | person: main.o person.o dog.o 3 | g++ -o $@ $^ 4 | 5 | %.o : %.cpp 6 | g++ -c -o $@ $^ 7 | 8 | clean: 9 | rm -f *.o person -------------------------------------------------------------------------------- /c++_learn/03th_structure/dog.cpp: -------------------------------------------------------------------------------- 1 | #include "dog.h" 2 | #include 3 | 4 | namespace D { 5 | 6 | using namespace std; 7 | 8 | void Dog::setName(char const *name) 9 | { 10 | this->name = name; 11 | } 12 | 13 | int Dog::setAge(int age) 14 | { 15 | if(age < 0 || age > 40) 16 | { 17 | this->age = 0; 18 | return -1; 19 | } 20 | this->age = age; 21 | return 0; 22 | } 23 | 24 | void Dog::printInfo(void) 25 | { 26 | //printf("name = %6s, age = %2d\n", name, age); 27 | cout<<"name = "< 2 | 3 | namespace D { 4 | 5 | class Dog { 6 | private: 7 | char const *name; 8 | int age; 9 | 10 | public: 11 | void setName(char const *name); 12 | int setAge(int age); 13 | void setWork(char const *work); 14 | void printInfo(void); 15 | }; 16 | 17 | void printVersion(void); 18 | 19 | } -------------------------------------------------------------------------------- /c++_learn/03th_structure/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "person.h" 3 | #include "dog.h" 4 | 5 | 6 | using namespace D; //把命名空间D全部导入,后面可以使用Dog来表示D:Dog 7 | //using D::Dog; //把D::Dog放入global namespace, 后面可以使用Dog来表示D:Dog 8 | 9 | 10 | int main(int argc, char **argv) 11 | { 12 | P::Person per; //指定调用哪个命名空间的Person 13 | per.setName("hceng"); 14 | per.setAge(23); 15 | per.setWork("Embedded engineer"); 16 | per.printInfo(); 17 | 18 | Dog dog; 19 | dog.setName("gougou"); 20 | dog.setAge(4); 21 | dog.printInfo(); 22 | 23 | P::printVersion(); 24 | D::printVersion(); 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /c++_learn/03th_structure/person.cpp: -------------------------------------------------------------------------------- 1 | #include "person.h" 2 | #include 3 | 4 | namespace P { 5 | 6 | void Person::setName(char const *name) 7 | { 8 | this->name = name; 9 | } 10 | 11 | int Person::setAge(int age) 12 | { 13 | if(age < 0 || age > 150) 14 | { 15 | this->age = 0; 16 | return -1; 17 | } 18 | this->age = age; 19 | return 0; 20 | } 21 | 22 | void Person::setWork(char const *work) 23 | { 24 | this->work = work; 25 | } 26 | 27 | 28 | void Person::printInfo(void) 29 | { 30 | //printf("name = %6s, age = %2d, work = %s\n", name, age, work); 31 | std::cout<<"name = "< 2 | 3 | namespace P { 4 | 5 | class Person { 6 | private: 7 | char const *name; 8 | int age; 9 | char const *work; 10 | 11 | public: 12 | void setName(char const *name); 13 | int setAge(int age); 14 | void setWork(char const *work); 15 | void printInfo(void); 16 | }; 17 | 18 | void printVersion(void); 19 | 20 | } -------------------------------------------------------------------------------- /c++_learn/04th_overload/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/04th_overload/main -------------------------------------------------------------------------------- /c++_learn/04th_overload/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int add(int a, int b) 6 | { 7 | cout<<"add int+int = "<name = name; 7 | } 8 | 9 | char *Human::getName(void) 10 | { 11 | return this->name; 12 | } 13 | 14 | Human::~Human() 15 | { 16 | cout<<"~Human()"< 5 | #include 6 | using namespace std; 7 | 8 | class Human { 9 | private: 10 | char *name; 11 | public: 12 | void setName(char *name); 13 | char *getName(void); 14 | 15 | virtual void eating(void) = 0; 16 | virtual void wearing(void) = 0; 17 | virtual void driving(void) = 0; 18 | 19 | virtual ~Human(); 20 | }; 21 | 22 | Human& CreateAmerican(char *name, int age, char *addr); 23 | Human& CreateChinese(char *name, int age, char *addr); 24 | 25 | #endif -------------------------------------------------------------------------------- /c++_learn/15th_abstract/Human.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/15th_abstract/Human.o -------------------------------------------------------------------------------- /c++_learn/15th_abstract/Makefile: -------------------------------------------------------------------------------- 1 | Human: main.o libHuman.so 2 | g++ -o $@ $< -L. -lHuman 3 | 4 | %.o : %.cpp 5 | g++ -fPIC -c -o $@ $< 6 | 7 | libHuman.so : Chinese.o American.o Human.o 8 | g++ -shared -o $@ $^ 9 | 10 | clean: 11 | rm -f *.o *.so Human 12 | 13 | -------------------------------------------------------------------------------- /c++_learn/15th_abstract/libHuman.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/15th_abstract/libHuman.so -------------------------------------------------------------------------------- /c++_learn/15th_abstract/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Human.h" 2 | 3 | void test_eating(Human *h) 4 | { 5 | h->eating(); 6 | } 7 | 8 | int main(int argc, char **argv) 9 | { 10 | Human& a = CreateAmerican((char *)"jk", 22, (char *)"America"); 11 | Human& c = CreateChinese((char *)"hceng", 23, (char *)"Chine"); 12 | 13 | Human* h[2] = {&a, &c}; 14 | int i; 15 | for (i=0; i<2; i++) 16 | test_eating(h[i]); 17 | delete &a; 18 | delete &c; 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /c++_learn/15th_abstract/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/15th_abstract/main.o -------------------------------------------------------------------------------- /c++_learn/16th_function_template/compare: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/16th_function_template/compare -------------------------------------------------------------------------------- /c++_learn/17th_class_template/car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/17th_class_template/car -------------------------------------------------------------------------------- /c++_learn/18th_exception/exception: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/18th_exception/exception -------------------------------------------------------------------------------- /c++_learn/19th_smartpointer/androidsmartpointer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/19th_smartpointer/androidsmartpointer -------------------------------------------------------------------------------- /c++_learn/19th_smartpointer/smartpointer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/19th_smartpointer/smartpointer -------------------------------------------------------------------------------- /c++_learn/20th_strongpointer_weekpointer/Makefile: -------------------------------------------------------------------------------- 1 | 2 | pointer: pointer.o RefBase.o 3 | g++ -o $@ $^ 4 | 5 | %.o : %.cpp 6 | g++ -c -o $@ $< -I include 7 | 8 | clean: 9 | rm -f *.o pointer -------------------------------------------------------------------------------- /c++_learn/20th_strongpointer_weekpointer/RefBase.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/20th_strongpointer_weekpointer/RefBase.o -------------------------------------------------------------------------------- /c++_learn/20th_strongpointer_weekpointer/include/cutils/log.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /c++_learn/20th_strongpointer_weekpointer/pointer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/20th_strongpointer_weekpointer/pointer -------------------------------------------------------------------------------- /c++_learn/20th_strongpointer_weekpointer/pointer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/20th_strongpointer_weekpointer/pointer.o -------------------------------------------------------------------------------- /c++_learn/21th_singleton/singleton: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/21th_singleton/singleton -------------------------------------------------------------------------------- /c++_learn/22th_bridge_mode/installos1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/22th_bridge_mode/installos1 -------------------------------------------------------------------------------- /c++_learn/22th_bridge_mode/installos2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/c++_learn/22th_bridge_mode/installos2 -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/10th_lcd/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += lcd.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/11th_ts/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += s3c_ts.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/11th_ts/s3c_ts.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/11th_ts/s3c_ts.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/11th_ts/tslib-1.4.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/11th_ts/tslib-1.4.tar.gz -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/12th_usb/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += usbmouse_as_key.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/12th_usb/usbmouse_as_key.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/12th_usb/usbmouse_as_key.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/13th_ramblock/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += ramblock.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/13th_ramblock/ramblock.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/13th_ramblock/ramblock.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/14th_nand/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += s3c_nand.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/14th_nand/mtd-utils-05.07.23.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/14th_nand/mtd-utils-05.07.23.tar.bz2 -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/14th_nand/s3c_nand.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/14th_nand/s3c_nand.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/15th_nor/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += s3c_nor.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/15th_nor/s3c_nor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/15th_nor/s3c_nor.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/16th_virt_net/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += virt_net.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/16th_virt_net/virt_net.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/16th_virt_net/virt_net.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/17th_dm9000c/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += dm9dev9000c.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/17th_dm9000c/dm9dev9000c.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/17th_dm9000c/dm9dev9000c.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/26th_debug_regeditor/first_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-2.6.22.6 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += first_drv.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/26th_debug_regeditor/first_drv/first_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/26th_debug_regeditor/first_drv/first_drv.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/26th_debug_regeditor/first_drv/firstdrvtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/26th_debug_regeditor/first_drv/firstdrvtest -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/26th_debug_regeditor/first_drv/firstdrvtest.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* firstdrvtest on 8 | * firstdrvtest off 9 | */ 10 | int main(int argc, char **argv) 11 | { 12 | int fd; 13 | int val = 1; 14 | fd = open("/dev/xyz", O_RDWR); 15 | if (fd < 0) 16 | { 17 | printf("can't open!\n"); 18 | } 19 | if (argc != 2) 20 | { 21 | printf("Usage :\n"); 22 | printf("%s \n", argv[0]); 23 | return 0; 24 | } 25 | 26 | if (strcmp(argv[1], "on") == 0) 27 | { 28 | val = 1; 29 | } 30 | else 31 | { 32 | val = 0; 33 | } 34 | 35 | write(fd, &val, 4); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/26th_debug_regeditor/ker_rw.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/26th_debug_regeditor/ker_rw.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/7th_buttons_all/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += buttons.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/7th_buttons_all/buttons.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/7th_buttons_all/buttons.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/7th_buttons_all/buttons_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/7th_buttons_all/buttons_test -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/8th_buttons_input/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += buttons.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/8th_buttons_input/buttons.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/8th_buttons_input/buttons.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/fb_test/Makefile: -------------------------------------------------------------------------------- 1 | CC=arm-linux-gcc 2 | 3 | fb_test: fb_test.c 4 | $(CC) -o $@ $^ 5 | 6 | clean: 7 | rm -f *.o fb_test 8 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/fifth_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += fifth_drv.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/fifth_drv/fifth_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/fifth_drv/fifth_drv.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/fifth_drv/fifthdrvtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/fifth_drv/fifthdrvtest -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/first_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += first_drv.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/first_drv/first_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/first_drv/first_drv.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/first_drv/firstdrvtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/first_drv/firstdrvtest -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/first_drv/firstdrvtest.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* firstdrvtest on 8 | * firstdrvtest off 9 | */ 10 | int main(int argc, char **argv) 11 | { 12 | int fd; 13 | int val = 1; 14 | fd = open("/dev/xyz", O_RDWR); 15 | if (fd < 0) 16 | { 17 | printf("can't open!\n"); 18 | } 19 | if (argc != 2) 20 | { 21 | printf("Usage :\n"); 22 | printf("%s \n", argv[0]); 23 | return 0; 24 | } 25 | 26 | if (strcmp(argv[1], "on") == 0) 27 | { 28 | val = 1; 29 | } 30 | else 31 | { 32 | val = 0; 33 | } 34 | 35 | write(fd, &val, 4); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/forth_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += forth_drv.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/forth_drv/forth_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/forth_drv/forth_drv.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/forth_drv/forthdrvtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/forth_drv/forthdrvtest -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/forth_drv/forthdrvtest.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | /* forthdrvtest 10 | */ 11 | int main(int argc, char **argv) 12 | { 13 | int fd; 14 | unsigned char key_val; 15 | int ret; 16 | 17 | struct pollfd fds[1]; 18 | 19 | fd = open("/dev/buttons", O_RDWR); 20 | if (fd < 0) 21 | { 22 | printf("can't open!\n"); 23 | } 24 | 25 | fds[0].fd = fd; 26 | fds[0].events = POLLIN; 27 | while (1) 28 | { 29 | ret = poll(fds, 1, 5000); 30 | if (ret == 0) 31 | { 32 | printf("time out\n"); 33 | } 34 | else 35 | { 36 | read(fd, &key_val, 1); 37 | printf("key_val = 0x%x\n", key_val); 38 | } 39 | } 40 | 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/second_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += second_drv.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/second_drv/second_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/second_drv/second_drv.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/second_drv/seconddrvtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/second_drv/seconddrvtest -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/second_drv/seconddrvtest.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* seconddrvtest 8 | */ 9 | int main(int argc, char **argv) 10 | { 11 | int fd; 12 | unsigned char key_vals[4]; 13 | int cnt = 0; 14 | 15 | fd = open("/dev/buttons", O_RDWR); 16 | if (fd < 0) 17 | { 18 | printf("can't open!\n"); 19 | } 20 | 21 | while (1) 22 | { 23 | read(fd, key_vals, sizeof(key_vals)); 24 | if (!key_vals[0] || !key_vals[1] || !key_vals[2] || !key_vals[3]) 25 | { 26 | printf("%04d key pressed: %d %d %d %d\n", cnt++, key_vals[0], key_vals[1], key_vals[2], key_vals[3]); 27 | } 28 | } 29 | 30 | return 0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/sixth_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += sixth_drv.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/sixth_drv/sixth_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/sixth_drv/sixth_drv.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/sixth_drv/sixthdrvtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/sixth_drv/sixthdrvtest -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/third_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/system/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += third_drv.o 11 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/third_drv/third_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/third_drv/third_drv.c -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/third_drv/thirddrvtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/third_drv/thirddrvtest -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/third_drv/thirddrvtest.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* thirddrvtest 8 | */ 9 | int main(int argc, char **argv) 10 | { 11 | int fd; 12 | unsigned char key_val; 13 | 14 | fd = open("/dev/buttons", O_RDWR); 15 | if (fd < 0) 16 | { 17 | printf("can't open!\n"); 18 | } 19 | 20 | while (1) 21 | { 22 | read(fd, &key_val, 1); 23 | printf("key_val = 0x%x\n", key_val); 24 | } 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/移植所有驱动到3.4.2内核去.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/移植所有驱动到3.4.2内核去.TXT -------------------------------------------------------------------------------- /drivers_jz2440_3.4.2/韦东山linux第二期视屏文档整理.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/drivers_jz2440_3.4.2/韦东山linux第二期视屏文档整理.docx -------------------------------------------------------------------------------- /hceng/learn_bus/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/hceng/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += kobject_test.o 11 | -------------------------------------------------------------------------------- /hceng/led/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/hceng/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += led_drv.o 11 | obj-m += led_dev.o 12 | 13 | -------------------------------------------------------------------------------- /hceng/led/led_test.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char **argv) 8 | { 9 | int fd; 10 | int val = 1; 11 | fd = open("/dev/led_by_hceng", O_RDWR); 12 | printf("fd = %d",fd); 13 | if (fd < 0) 14 | { 15 | printf("can't open!\n"); 16 | } 17 | if (argc != 2) 18 | { 19 | printf("Usage :\n"); 20 | printf("%s \n", argv[0]); 21 | return 0; 22 | } 23 | 24 | if (strcmp(argv[1], "on") == 0) 25 | { 26 | val = 1; 27 | } 28 | else 29 | { 30 | val = 0; 31 | } 32 | 33 | write(fd, &val, 4); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/Makefile: -------------------------------------------------------------------------------- 1 | PREFIX=arm-linux-gnueabihf- 2 | CC=$(PREFIX)gcc 3 | LD=$(PREFIX)ld 4 | AR=$(PREFIX)ar 5 | OBJCOPY=$(PREFIX)objcopy 6 | OBJDUMP=$(PREFIX)objdump 7 | 8 | imx6ul.bin : start.S led.c ddr.c 9 | $(CC) -nostdlib -g -c -o start.o start.S 10 | $(CC) -nostdlib -g -c -o led.o led.c 11 | $(CC) -nostdlib -g -c -o ddr.o ddr.c 12 | $(LD) -Ttext 0x40300000 -g start.o led.o ddr.o -o imx6ul_elf 13 | $(OBJCOPY) -O binary -S imx6ul_elf imx6ul.bin 14 | $(OBJDUMP) -D -m arm imx6ul_elf > imx6ul.dis 15 | 16 | clean: 17 | rm -f imx6ul.dis imx6ul.bin imx6ul_elf *.o 18 | 19 | 20 | -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/README: -------------------------------------------------------------------------------- 1 | Use: 2 | cd /work/imx6ul/sd 3 | ./mkimage -n imximage.cfg.cfgtmp -T imximage -e 0x87800000 -d /work/imx6ul/led/led.bin myled.bin 4 | sudo dd if=myled.bin of=/dev/sdb bs=512 seek=2 conv=fsync 5 | -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/ddr.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/ddr/ddr.c -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/imx6ul.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/ddr/imx6ul.bin -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/ddr/led.c -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/mkimage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/ddr/mkimage -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/myimx6ul.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/ddr/myimx6ul.bin -------------------------------------------------------------------------------- /imx6ull/hardware/ddr/start.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/ddr/start.S -------------------------------------------------------------------------------- /imx6ull/hardware/led/Makefile: -------------------------------------------------------------------------------- 1 | PREFIX=arm-linux-gnueabihf- 2 | CC=$(PREFIX)gcc 3 | LD=$(PREFIX)ld 4 | AR=$(PREFIX)ar 5 | OBJCOPY=$(PREFIX)objcopy 6 | OBJDUMP=$(PREFIX)objdump 7 | 8 | led.bin : start.S led.c 9 | $(CC) -nostdlib -g -c -o start.o start.S 10 | $(CC) -nostdlib -g -c -o led.o led.c 11 | $(LD) -Ttext 0x40300000 -g start.o led.o -o led_elf 12 | $(OBJCOPY) -O binary -S led_elf led.bin 13 | $(OBJDUMP) -D -m arm led_elf > led.dis 14 | 15 | clean: 16 | rm -f led.dis led.bin led_elf *.o 17 | 18 | 19 | -------------------------------------------------------------------------------- /imx6ull/hardware/led/README: -------------------------------------------------------------------------------- 1 | Use: 2 | cd /work/imx6ul/sd 3 | ./mkimage -n imximage.cfg.cfgtmp -T imximage -e 0x87800000 -d /work/imx6ul/led/led.bin myled.bin 4 | sudo dd if=myled.bin of=/dev/sdb bs=512 seek=2 conv=fsync 5 | -------------------------------------------------------------------------------- /imx6ull/hardware/led/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/led/led.c -------------------------------------------------------------------------------- /imx6ull/hardware/led/mkimage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/led/mkimage -------------------------------------------------------------------------------- /imx6ull/hardware/led/myled.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/led/myled.bin -------------------------------------------------------------------------------- /imx6ull/hardware/led/start.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/led/start.S -------------------------------------------------------------------------------- /imx6ull/hardware/uart/imx6ul.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/imx6ul.bin -------------------------------------------------------------------------------- /imx6ull/hardware/uart/imx6ul.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x80000000; 3 | .text : { start.o(.text) 4 | main.o(.text) 5 | led.o(.text) 6 | uart.o(.text) 7 | printf.o(.text) 8 | *(.text) 9 | } 10 | .rodata ALIGN(4) : {*(.rodata*)} 11 | .data ALIGN(4) : { *(.data) } 12 | __bss_start = .; 13 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 14 | __bss_end = .; 15 | } 16 | -------------------------------------------------------------------------------- /imx6ull/hardware/uart/imx6ul_elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/imx6ul_elf -------------------------------------------------------------------------------- /imx6ull/hardware/uart/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/led.c -------------------------------------------------------------------------------- /imx6ull/hardware/uart/led.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __LED_H__ 3 | #define __LED_H__ 4 | 5 | extern void led_mode(int mode); 6 | extern void delay(unsigned int i); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /imx6ull/hardware/uart/led.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/led.o -------------------------------------------------------------------------------- /imx6ull/hardware/uart/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include "uart.h" 3 | #include "printf.h" 4 | #include "led.h" 5 | 6 | 7 | int main() 8 | { 9 | 10 | uart_init(); 11 | 12 | while(1) 13 | { 14 | printf_test(); 15 | 16 | delay(10000000); 17 | } 18 | 19 | return 0; 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /imx6ull/hardware/uart/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/main.o -------------------------------------------------------------------------------- /imx6ull/hardware/uart/mkimage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/mkimage -------------------------------------------------------------------------------- /imx6ull/hardware/uart/myimx6ul.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/myimx6ul.bin -------------------------------------------------------------------------------- /imx6ull/hardware/uart/printf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PRINTF_H 3 | #define _PRINTF_H 4 | 5 | #include "uart.h" 6 | #define __out_putchar uart_PutChar 7 | 8 | 9 | #define MAX_NUMBER_BYTES 64 10 | extern int printf_test(void); 11 | int printf(const char *fmt, ...); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /imx6ull/hardware/uart/printf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/printf.o -------------------------------------------------------------------------------- /imx6ull/hardware/uart/start.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/start.S -------------------------------------------------------------------------------- /imx6ull/hardware/uart/start.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/start.o -------------------------------------------------------------------------------- /imx6ull/hardware/uart/uart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/uart.c -------------------------------------------------------------------------------- /imx6ull/hardware/uart/uart.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __UART_H__ 3 | #define __UART_H__ 4 | 5 | void raise (int sig_nr); 6 | extern void uart_init(); 7 | extern void uart_PutChar(char c); 8 | 9 | extern void uart_PutString(char *ptr); 10 | //extern void printHex(unsigned int val); 11 | 12 | unsigned int get_uart_clk(void); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /imx6ull/hardware/uart/uart.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/imx6ull/hardware/uart/uart.o -------------------------------------------------------------------------------- /io/day1/1-fopen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | FILE * fp; 6 | unsigned int i = 0; 7 | 8 | fp = fopen(argv[1], "w"); 9 | if(fp == NULL) 10 | { 11 | printf("Unable to fopen \n"); 12 | return -1; 13 | } 14 | /* printf("argc = %d\n",argc); 15 | for(i; i 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | FILE * fp; 6 | int count = 0; 7 | fclose(stdin); 8 | while((fp = fopen(argv[1], "r")) != NULL) 9 | count++; 10 | 11 | printf("count = %d \n", count); 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /io/day1/3-fgetc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | FILE * fp; 6 | 7 | fp = fopen(argv[1], "r"); 8 | if(fp == NULL) 9 | { 10 | printf("Unable to fopen\n"); 11 | return -1; 12 | } 13 | 14 | char ch = fgetc(fp); 15 | ch = fgetc(fp); 16 | ch = fgetc(fp); 17 | 18 | //printf("ch = %c \n", ch); 19 | 20 | fputc(ch, stdout); 21 | putchar(10); 22 | fclose(fp); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /io/day1/4-cat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | FILE *fp_r; 6 | char ch; 7 | 8 | fp_r = fopen(argv[1], "r"); 9 | if(fp_r == NULL) 10 | { 11 | // printf("Unable to fopen \n"); 12 | fprintf(stdout, "Unable to fopen \n"); 13 | return -1; 14 | } 15 | 16 | while((ch = fgetc(fp_r)) != EOF) 17 | { 18 | //printf("%c",ch); 19 | fputc(ch, stdout); 20 | } 21 | fclose(fp_r); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /io/day1/5-cp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | FILE *fp_r, *fp_w; 6 | char ch; 7 | 8 | fp_r = fopen(argv[1], "r"); 9 | if(fp_r == NULL) 10 | { 11 | fprintf(stdout,"Unable to fopen fp_r\n"); 12 | return -1; 13 | } 14 | 15 | fp_w = fopen(argv[2], "w"); 16 | if(fp_w == NULL) 17 | { 18 | fprintf(stdout, "Unable to fopen fp_w \n"); 19 | } 20 | 21 | while((ch = fgetc(fp_r)) != EOF) 22 | { 23 | fputc(ch, fp_w); 24 | } 25 | 26 | 27 | fclose(fp_r); 28 | fclose(fp_w); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /io/day1/6-line.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | FILE *fp_r; 6 | char ch; 7 | int line = 0; 8 | 9 | fp_r = fopen(argv[1], "r"); 10 | if(fp_r == NULL) 11 | { 12 | fprintf(stdout, "Unable to fopen \n"); 13 | return -1; 14 | } 15 | 16 | while((ch = fgetc(fp_r)) != EOF) 17 | { 18 | if(ch == '\n') 19 | line++; 20 | } 21 | 22 | printf("line = %d \n",line); 23 | fclose(fp_r); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /io/day1/7-fgets.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define N 32 4 | 5 | int main(int argc, const char *argv[]) 6 | { 7 | FILE *fp_r; 8 | char buf[N] = {0}; 9 | 10 | fp_r = fopen(argv[1], "r"); 11 | if(fp_r == NULL) 12 | { 13 | fprintf(stdout, "Unable to fopen fp_r \n"); 14 | return -1; 15 | } 16 | 17 | fgets(buf, 32, fp_r); 18 | 19 | fputs(buf, stdout); 20 | 21 | fclose(fp_r); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /io/day1/8-fgets_cp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define N 32 4 | 5 | int main(int argc, const char *argv[]) 6 | { 7 | FILE *fp_r, *fp_w; 8 | char buf[N] = {0}; 9 | 10 | fp_r = fopen(argv[1], "r"); 11 | if(fp_r == NULL) 12 | { 13 | fprintf(stdout, "Unable to fopen fp_r \n"); 14 | return -1; 15 | 16 | } 17 | fp_w = fopen(argv[2], "w"); 18 | if(fp_w == NULL) 19 | { 20 | fprintf(stdout, "Unable to fopen fp_w \n"); 21 | return -1; 22 | } 23 | 24 | while(fgets(buf, 16, fp_r) != NULL) 25 | fputs(buf, fp_w); 26 | fclose(fp_r); 27 | fclose(fp_w); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /io/day1/9-fread_fwrite.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define N 32 4 | 5 | int main(int argc, const char *argv[]) 6 | { 7 | FILE *fp_r, *fp_w; 8 | char buf[N] = {0}; 9 | 10 | fp_r = fopen(argv[1], "r"); 11 | if(fp_r == NULL) 12 | { 13 | fprintf(stdout, "Unable to fopen fp_r\n"); 14 | return -1; 15 | } 16 | 17 | fp_w = fopen(argv[2], "w"); 18 | if(fp_w == NULL) 19 | { 20 | fprintf(stdout, "Unable to fopen fp_w\n"); 21 | return -1; 22 | } 23 | size_t bytes = fread(buf, 5, 3, fp_r); 24 | fwrite(buf, 5, 2, fp_w); 25 | 26 | //printf("bytes = %d \n",bytes); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /io/day1/cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/cat -------------------------------------------------------------------------------- /io/day1/cp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/cp -------------------------------------------------------------------------------- /io/day1/cp_hceng.txt: -------------------------------------------------------------------------------- 1 | for test 2 | l -------------------------------------------------------------------------------- /io/day1/fgetc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/fgetc -------------------------------------------------------------------------------- /io/day1/fgets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/fgets -------------------------------------------------------------------------------- /io/day1/fgets_cp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/fgets_cp -------------------------------------------------------------------------------- /io/day1/fopen_max: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/fopen_max -------------------------------------------------------------------------------- /io/day1/fread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/fread -------------------------------------------------------------------------------- /io/day1/hceng.txt: -------------------------------------------------------------------------------- 1 | for test 2 | line2 3 | line3 4 | -------------------------------------------------------------------------------- /io/day1/u_cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/u_cat -------------------------------------------------------------------------------- /io/day1/u_cp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/u_cp -------------------------------------------------------------------------------- /io/day1/u_line: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day1/u_line -------------------------------------------------------------------------------- /io/day2/cp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/cp -------------------------------------------------------------------------------- /io/day2/cp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #define N 32 8 | 9 | int main(int argc, const char *argv[]) 10 | { 11 | int fd_r, fd_w; 12 | ssize_t bytes = 0; 13 | char buf[N] = {0}; 14 | 15 | fd_r = open(argv[1], O_RDONLY); 16 | if(fd_r < 0) 17 | { 18 | perror("Unable to open fd_r"); 19 | return -1; 20 | } 21 | 22 | fd_w = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0666); 23 | if(fd_w < 0) 24 | { 25 | perror("Unable to open fd_w"); 26 | return -1; 27 | } 28 | 29 | while((bytes = read(fd_r, buf, 32)) != 0) 30 | write(fd_w, buf, bytes); 31 | 32 | close(fd_r); 33 | close(fd_w); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /io/day2/cp.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #define N 32 8 | 9 | int main(int argc, const char *argv[]) 10 | { 11 | int fd_r, fd_w; 12 | ssize_t bytes = 0; 13 | char buf[N] = {0}; 14 | 15 | fd_r = open(argv[1], O_RDONLY); 16 | if(fd_r < 0) 17 | { 18 | perror("Unable to open fd_r"); 19 | return -1; 20 | } 21 | 22 | fd_w = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0666); 23 | if(fd_w < 0) 24 | { 25 | perror("Unable to open fd_w"); 26 | return -1; 27 | } 28 | 29 | while((bytes = read(fd_r, buf, 32)) != 0) 30 | write(fd_w, buf, bytes); 31 | 32 | close(fd_r); 33 | close(fd_w); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /io/day2/hceng.txt: -------------------------------------------------------------------------------- 1 | 1. 2017-3-26 0:52:0 2 | 2. 2017-3-26 0:52:1 3 | 3. 2017-3-26 0:52:2 4 | 4. 2017-3-26 0:52:3 5 | 5. 2017-3-26 0:52:4 6 | 6. 2017-3-26 0:52:11 7 | 7. 2017-3-26 0:52:12 8 | 8. 2017-3-26 0:52:13 9 | -------------------------------------------------------------------------------- /io/day2/hceng_time: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/hceng_time -------------------------------------------------------------------------------- /io/day2/hole: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/hole -------------------------------------------------------------------------------- /io/day2/hole.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | int main(int argc, const char *argv[]) 9 | { 10 | int fd_w; 11 | char ch = 'a'; 12 | 13 | fd_w = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0666); 14 | if(fd_w < 0) 15 | { 16 | perror("Unable to open fd_w"); 17 | return -1; 18 | } 19 | 20 | lseek(fd_w, 500, SEEK_SET); 21 | write(fd_w, &ch, 1); 22 | close(fd_w); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /io/day2/hole.txt: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /io/day2/open: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/open -------------------------------------------------------------------------------- /io/day2/open.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | int main(int argc, const char *argv[]) 9 | { 10 | int fd; 11 | fd = open(argv[1], O_RDONLY | O_CREAT | O_EXCL, 0666); 12 | if(fd < 0) 13 | { 14 | perror("Unable to open"); 15 | return -1; 16 | } 17 | 18 | printf("fd = %d \n", fd); 19 | 20 | close(fd); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /io/day2/opendir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/opendir -------------------------------------------------------------------------------- /io/day2/opendir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, const char *argv[]) 7 | { 8 | DIR * dir; 9 | struct dirent *myread; 10 | 11 | dir = opendir(argv[1]); 12 | if(dir == NULL) 13 | { 14 | perror("Unable to opendir"); 15 | return -1; 16 | } 17 | #if 0 18 | myread = readdir(dir); 19 | 20 | printf("%s \n", myread->d_name); 21 | #endif 22 | 23 | while((myread= readdir(dir)) != NULL) 24 | { 25 | if(myread->d_name[0] != '.') 26 | printf("%s \n", myread->d_name); 27 | } 28 | closedir(dir); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /io/day2/read_write: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/read_write -------------------------------------------------------------------------------- /io/day2/read_write.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #define N 32 8 | 9 | int main(int argc, const char *argv[]) 10 | { 11 | char buf[N] = {0}; 12 | while(1) 13 | { 14 | ssize_t bytes = read(0, buf, 16); 15 | 16 | write(1, buf, bytes); 17 | } 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /io/day2/rewind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/rewind -------------------------------------------------------------------------------- /io/day2/rewind.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | FILE *fp; 6 | 7 | fp = fopen(argv[1], "r+"); 8 | if(fp == NULL) 9 | { 10 | fprintf(stdout,"Unable to fopen \n"); 11 | return -1; 12 | } 13 | 14 | fseek(fp, 0, SEEK_SET); 15 | fgetc(fp); 16 | fgetc(fp); 17 | long pos = ftell(fp); 18 | printf("pos = %ld \n", pos); 19 | 20 | rewind(fp); 21 | pos = ftell(fp); 22 | printf("pos = %ld \n", pos); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /io/day2/test.txt: -------------------------------------------------------------------------------- 1 | 1, 2016-11-11 10: 20 : 26 2 | 2, 2016-11-11 10: 20 : 27 3 | 3, 2016-11-11 10: 20 : 28 4 | 4, 2016-11-11 10: 20 : 29 5 | 5, 2016-11-11 10: 20 : 37 6 | 6, 2016-11-11 10: 20 : 38 7 | 7, 2016-11-11 10: 20 : 39 8 | 8, 2016-11-11 10: 20 : 40 9 | 9, 2016-11-11 10: 20 : 41 10 | -------------------------------------------------------------------------------- /io/day2/text: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/text -------------------------------------------------------------------------------- /io/day2/time: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day2/time -------------------------------------------------------------------------------- /io/day2/time.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, const char *argv[]) 5 | { 6 | FILE *fp; 7 | char ch; 8 | time_t myt; 9 | struct tm *mytm; 10 | int line = 0; 11 | 12 | //打开文件 13 | fp = fopen(argv[1], "a+"); 14 | if(fp == NULL) 15 | { 16 | fprintf(stderr, "Unable to fopen \n"); 17 | return -1; 18 | } 19 | 20 | //获取行数 21 | while((ch = fgetc(fp)) != EOF) 22 | { 23 | if(ch == '\n') 24 | { 25 | line++; 26 | } 27 | } 28 | 29 | while(1) 30 | { 31 | time(&myt); 32 | mytm = localtime(&myt); 33 | fprintf(fp, "%d, %d-%d-%d %d: %d : %d \n",++line, mytm->tm_year + 1900, mytm->tm_mon + 1, mytm->tm_mday, 34 | mytm->tm_hour, mytm->tm_min, mytm->tm_sec); 35 | fflush(fp); 36 | sleep(1); 37 | } 38 | 39 | 40 | return 0; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /io/day3/dynamic/add.c: -------------------------------------------------------------------------------- 1 | int add(int a, int b) 2 | { 3 | return a+b; 4 | } 5 | -------------------------------------------------------------------------------- /io/day3/dynamic/add.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/dynamic/add.o -------------------------------------------------------------------------------- /io/day3/dynamic/libmythirdmath.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/dynamic/libmythirdmath.so -------------------------------------------------------------------------------- /io/day3/dynamic/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/dynamic/main -------------------------------------------------------------------------------- /io/day3/dynamic/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | int x = 8, y = 9; 6 | 7 | printf("x + y = %d \nx - y = %d \n", add(x, y), sub(x, y)); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /io/day3/dynamic/sub.c: -------------------------------------------------------------------------------- 1 | int sub(int a, int b) 2 | { 3 | return a-b; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /io/day3/dynamic/sub.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/dynamic/sub.o -------------------------------------------------------------------------------- /io/day3/exit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/exit -------------------------------------------------------------------------------- /io/day3/exit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | //#include 4 | 5 | int main(int argc, const char *argv[]) 6 | { 7 | printf("hello world\n"); 8 | _exit(5); 9 | //exit(5); 10 | printf("hello Shenzhen\n"); 11 | return 0; 12 | } 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /io/day3/fork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/fork -------------------------------------------------------------------------------- /io/day3/fork.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, const char *argv[]) 5 | { 6 | 7 | pid_t pid; 8 | 9 | printf("hello world\n"); 10 | pid = fork(); 11 | printf("pid = %d\n",pid); 12 | 13 | if(pid < 0) 14 | { 15 | perror("Unable to fork"); 16 | return -1; 17 | } 18 | 19 | if(pid == 0) 20 | { 21 | //子进程 22 | printf("child process parent %d ,child = %d\n",getppid(), getpid()); 23 | } 24 | else 25 | { 26 | //父进程: 27 | printf("parent process = %d, child = %d\n", getpid(), pid); 28 | } 29 | while(1); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /io/day3/fork1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/fork1 -------------------------------------------------------------------------------- /io/day3/fork2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/fork2 -------------------------------------------------------------------------------- /io/day3/fork_1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, const char *argv[]) 5 | { 6 | 7 | pid_t pid; 8 | pid = fork(); 9 | 10 | if(pid < 0) 11 | { 12 | perror("Unable to fork"); 13 | return -1; 14 | } 15 | 16 | if(pid == 0) 17 | { 18 | //子进程 19 | printf("child process parent %d ,child = %d\n",getppid(), getpid()); 20 | } 21 | else 22 | { 23 | //父进程: 24 | printf("parent process = %d, child = %d\n", getpid(), pid); 25 | while(1); 26 | } 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /io/day3/fork_2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, const char *argv[]) 7 | { 8 | 9 | pid_t pid; 10 | pid = fork(); 11 | 12 | if(pid < 0) 13 | { 14 | perror("Unable to fork"); 15 | return -1; 16 | } 17 | 18 | if(pid == 0) 19 | { 20 | //子进程 21 | printf("child process parent %d ,child = %d\n",getppid(), getpid()); 22 | exit(0); 23 | } 24 | else 25 | { 26 | //父进程: 27 | int status; 28 | sleep(4); 29 | wait(&status); 30 | printf("child exit\n"); 31 | sleep(4); 32 | printf("parent status = %d\n", status); 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /io/day3/static/add.c: -------------------------------------------------------------------------------- 1 | int add(int a, int b) 2 | { 3 | return a+b; 4 | } 5 | -------------------------------------------------------------------------------- /io/day3/static/add.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/static/add.o -------------------------------------------------------------------------------- /io/day3/static/libmysecmath.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/static/libmysecmath.a -------------------------------------------------------------------------------- /io/day3/static/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/static/main -------------------------------------------------------------------------------- /io/day3/static/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | int x = 8, y = 9; 6 | 7 | printf("x + y = %d \nx - y = %d \n", add(x, y), sub(x, y)); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /io/day3/static/sub.c: -------------------------------------------------------------------------------- 1 | int sub(int a, int b) 2 | { 3 | return a-b; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /io/day3/static/sub.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day3/static/sub.o -------------------------------------------------------------------------------- /io/day3/while.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | // getchar(); 6 | while(1) 7 | { 8 | 9 | printf("hello world \n"); 10 | sleep(1); 11 | } 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /io/day4/dameon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day4/dameon -------------------------------------------------------------------------------- /io/day4/exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day4/exec -------------------------------------------------------------------------------- /io/day4/exec.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, const char *argv[]) 6 | { 7 | printf("hello start \n"); 8 | #if 1 9 | if(execl("/bin/ls", "ls", "-l", "-a", NULL) < 0) 10 | { 11 | perror("Unable to execl"); 12 | exit(1); 13 | } 14 | #endif 15 | 16 | #if 0 17 | if(execlp("ls", "ls", "-l", "-a", NULL) < 0) 18 | { 19 | perror("Unable to execl"); 20 | exit(1); 21 | } 22 | #endif 23 | 24 | #if 0 25 | char *arg[] = {"ls", "-la", NULL}; 26 | if(execv("/bin/ls", arg) < 0) 27 | { 28 | perror("Unable to execl"); 29 | exit(1); 30 | } 31 | #endif 32 | printf("hello end \n"); 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /io/day4/pthread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day4/pthread -------------------------------------------------------------------------------- /io/day4/pthread.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void *pthread_fun(void * arg) 7 | { 8 | int i = 20; 9 | printf("*arg = %d \n", *(int *)arg); 10 | while(i--) 11 | { 12 | printf("pthread i = %d \n", i); 13 | sleep(1); 14 | if(i == 10) 15 | pthread_exit("pthread exit"); 16 | } 17 | } 18 | 19 | int main(int argc, const char *argv[]) 20 | { 21 | pthread_t tid; 22 | int num = 18; 23 | 24 | if(pthread_create(&tid, NULL, pthread_fun, &num) != 0) 25 | { 26 | perror("Unable to pthread_create"); 27 | exit(1); 28 | } 29 | printf("pthread start \n"); 30 | void * ret; 31 | pthread_join(tid, &ret); 32 | //while(1); 33 | printf("pthread end %s \n", (char *)ret); 34 | return 0; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /io/day4/pthread_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day4/pthread_1 -------------------------------------------------------------------------------- /io/day4/pthread_mutex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day4/pthread_mutex -------------------------------------------------------------------------------- /io/day4/pthread_syns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day4/pthread_syns -------------------------------------------------------------------------------- /io/day4/pthread_syns.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define N 32 7 | 8 | char buf[N] = {0}; 9 | sem_t mysem; 10 | 11 | void *pthread_fun(void * arg) 12 | { 13 | while(1) 14 | { 15 | sem_wait(&mysem); 16 | printf("--> %s\n",buf); 17 | } 18 | } 19 | 20 | int main(int argc, const char *argv[]) 21 | { 22 | pthread_t tid; 23 | sem_init(&mysem, 0, 0); 24 | if(pthread_create(&tid, NULL, pthread_fun, NULL) != 0) 25 | { 26 | perror("Unable to pthread_create"); 27 | exit(1); 28 | } 29 | while(1) 30 | { 31 | fgets(buf, 32, stdin); 32 | sem_post(&mysem); 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /io/day5/alarm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/alarm -------------------------------------------------------------------------------- /io/day5/alarm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, const char *argv[]) 5 | { 6 | int ret = -1; 7 | ret = alarm(9); 8 | printf("ret = %d \n", ret); 9 | sleep(3); 10 | ret = alarm(10); 11 | printf("ret = %d \n", ret); 12 | pause(); 13 | 14 | printf("hello world \n"); 15 | //while(1); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /io/day5/cp.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #define N 32 8 | 9 | int main(int argc, const char *argv[]) 10 | { 11 | int fd_r, fd_w; 12 | size_t bytes = 0; 13 | char buf[N] = {0}; 14 | 15 | if(mkfifo("myfifo", 0666) < 0) 16 | { 17 | perror("Unable to mkfifo"); 18 | // exit(1); 19 | } 20 | 21 | fd_r = open(argv[1], O_RDONLY); 22 | if(fd_r < 0) 23 | { 24 | perror("Unable to open"); 25 | exit(1); 26 | } 27 | fd_w = open("myfifo", O_WRONLY); 28 | if(fd_w < 0) 29 | { 30 | perror("Unable to open fd_w"); 31 | exit(1); 32 | } 33 | 34 | while((bytes = read(fd_r, buf, 32)) != 0) 35 | { 36 | write(fd_w, buf, bytes); 37 | } 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /io/day5/kill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/kill -------------------------------------------------------------------------------- /io/day5/kill.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, const char *argv[]) 6 | { 7 | if(kill(atoi(argv[1]), atoi(argv[2])) < 0) 8 | { 9 | perror("Unable to kill"); 10 | exit(1); 11 | } 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /io/day5/mkfifo_r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/mkfifo_r -------------------------------------------------------------------------------- /io/day5/mkfifo_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define N 32 10 | 11 | int main(int argc, const char *argv[]) 12 | { 13 | int fd_r; 14 | size_t bytes = 0; 15 | char buf[N] = {0}; 16 | 17 | 18 | fd_r = open("myfifo", O_RDONLY); 19 | if(fd_r < 0) 20 | { 21 | perror("Unable to open fd_r"); 22 | exit(1); 23 | } 24 | 25 | while(1) 26 | { 27 | read(fd_r, buf, 32); 28 | if(strncmp(buf, "quit", 4) == 0) 29 | break; 30 | printf("--> %s \n", buf); 31 | } 32 | close(fd_r); 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /io/day5/mkfifo_w: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/mkfifo_w -------------------------------------------------------------------------------- /io/day5/mkfifo_w.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define N 32 10 | 11 | int main(int argc, const char *argv[]) 12 | { 13 | int fd_r, fd_w; 14 | size_t bytes = 0; 15 | char buf[N] = {0}; 16 | 17 | if(mkfifo("myfifo", 0666) < 0) 18 | { 19 | perror("Unable to mkfifo"); 20 | // exit(1); 21 | } 22 | fd_w = open("myfifo", O_WRONLY); 23 | if(fd_w < 0) 24 | { 25 | perror("Unable to open fd_w."); 26 | exit(1); 27 | } 28 | printf("fifo write\n"); 29 | 30 | while(1) 31 | { 32 | fgets(buf, 32, stdin); 33 | write(fd_w, buf, strlen(buf) + 1); 34 | if(strncmp(buf, "quit", 4) == 0) 35 | break; 36 | } 37 | close(fd_w); 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /io/day5/pipe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/pipe -------------------------------------------------------------------------------- /io/day5/pthread/manpages-posix-dev_2.16-1_all.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/pthread/manpages-posix-dev_2.16-1_all.deb -------------------------------------------------------------------------------- /io/day5/pthread/manpages-posix_2.16-1_all.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/pthread/manpages-posix_2.16-1_all.deb -------------------------------------------------------------------------------- /io/day5/raise: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/raise -------------------------------------------------------------------------------- /io/day5/raise.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, const char *argv[]) 6 | { 7 | printf("hello wrold.\n"); 8 | if(raise(atoi(argv[1])) < 0) 9 | { 10 | perror("Unable to raise"); 11 | exit(1); 12 | } 13 | while(1); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /io/day5/signal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day5/signal -------------------------------------------------------------------------------- /io/day5/signal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | //signo代表内核相当前进程发送的信号时什么?而我们又不清楚时那个信号 5 | //需要用if语句做判断 6 | void fun(int signo) 7 | { 8 | if(signo == SIGINT) 9 | { 10 | printf("hello world \n"); 11 | } 12 | } 13 | 14 | int main(int argc, const char *argv[]) 15 | { 16 | //信号处理函数,本身不具有阻塞作用 17 | //第一个参数: 要出里的信号是什么?62中的一种 18 | //第二个参数: 三种相应方式: 19 | //忽略(SIG_IGN)、默认(SIG_DFL)、捕捉(用户自定义函数) 20 | signal(SIGINT, fun); 21 | pause(); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /io/day5/while.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char *argv[]) 4 | { 5 | while(1) 6 | { 7 | sleep(1); 8 | printf("nihao\n"); 9 | } 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /io/day6/driver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day6/driver -------------------------------------------------------------------------------- /io/day6/ftok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day6/ftok -------------------------------------------------------------------------------- /io/day6/ftok.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | int main(int argc, const char *argv[]) 6 | { 7 | key_t key; 8 | 9 | key = ftok(".", 'a'); 10 | if(key < 0) 11 | { 12 | perror("Unable to ftok"); 13 | exit(1); 14 | } 15 | printf("key = %#x \n", key); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /io/day6/msg/msg_r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day6/msg/msg_r -------------------------------------------------------------------------------- /io/day6/msg/msg_w: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day6/msg/msg_w -------------------------------------------------------------------------------- /io/day6/shm_r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day6/shm_r -------------------------------------------------------------------------------- /io/day6/shm_w: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/io/day6/shm_w -------------------------------------------------------------------------------- /java_learn/01th_hello/Hello.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/01th_hello/Hello.class -------------------------------------------------------------------------------- /java_learn/01th_hello/Hello.java: -------------------------------------------------------------------------------- 1 | public class Hello { 2 | public static void main(String args[]) { 3 | System.out.println("Hello world!"); 4 | } 5 | } -------------------------------------------------------------------------------- /java_learn/02th_var/Var.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/02th_var/Var.class -------------------------------------------------------------------------------- /java_learn/03th_method/Method.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/03th_method/Method.class -------------------------------------------------------------------------------- /java_learn/03th_method/Method.java: -------------------------------------------------------------------------------- 1 | public class Method { 2 | public static void main(String args[]) { 3 | System.out.println(add(1, 2)); 4 | System.out.println(add(1, 2, 3)); 5 | System.out.println(add(1.0f, 2.0f)); 6 | } 7 | 8 | public static int add (int x, int y) { 9 | return x + y; 10 | } 11 | 12 | public static int add (int x, int y, int z) { 13 | return x + y + z; 14 | } 15 | 16 | public static float add (float x, float y) { 17 | return x + y; 18 | } 19 | } -------------------------------------------------------------------------------- /java_learn/04th_param/Param.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/04th_param/Param.class -------------------------------------------------------------------------------- /java_learn/04th_param/Param.java: -------------------------------------------------------------------------------- 1 | public class Param { 2 | public static void main(String args[]) { 3 | int x = 1; 4 | System.out.println("Before x=" + x); 5 | fun(x); 6 | System.out.println("After x=" + x); 7 | 8 | int p[] = new int[1]; 9 | p[0] = 2; 10 | System.out.println("Before p=" + p[0]); 11 | fun(p); 12 | System.out.println("After p=" + p[0]); 13 | 14 | } 15 | 16 | public static void fun(int x) { 17 | x = 100; 18 | } 19 | 20 | public static void fun(int[] p) { 21 | p[0] = 200; 22 | } 23 | } -------------------------------------------------------------------------------- /java_learn/05th_oop/Oop.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/05th_oop/Oop.class -------------------------------------------------------------------------------- /java_learn/05th_oop/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/05th_oop/Person.class -------------------------------------------------------------------------------- /java_learn/06th_enc/Enc.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/06th_enc/Enc.class -------------------------------------------------------------------------------- /java_learn/06th_enc/Enc.java: -------------------------------------------------------------------------------- 1 | class Person { 2 | /* 成员变量 */ 3 | //int age; //default 4 | private int age; //私有,只能供类内部访问 5 | 6 | /* 成员方法 */ 7 | public void setAge(int age) { 8 | if (age < 0 || age > 200) 9 | age = 0; 10 | else 11 | this.age = age; 12 | } 13 | 14 | public int getAge() { 15 | return age; 16 | } 17 | } 18 | 19 | public class Enc { 20 | public static void main(String args[]) { 21 | Person per = new Person(); 22 | //per.age = -1; 23 | per.setAge(-1); 24 | 25 | System.out.println(per.getAge()); 26 | } 27 | } -------------------------------------------------------------------------------- /java_learn/06th_enc/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/06th_enc/Person.class -------------------------------------------------------------------------------- /java_learn/07th_extends/A.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/A.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Abstract.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Abstract.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Abstract.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Abstract.java -------------------------------------------------------------------------------- /java_learn/07th_extends/B.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/B.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Ext.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Ext.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Father.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Father.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Interface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Interface.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Interface.java: -------------------------------------------------------------------------------- 1 | //接口 2 | interface A { 3 | public static final int i = 10; //接口只能定义常量 4 | public abstract void printNum(); 5 | } 6 | 7 | interface B { 8 | public static final String name = "hceng"; 9 | public abstract void printString(); 10 | } 11 | 12 | //子类 13 | class Son implements A,B { 14 | public void printNum() { //实现接口定义的方法 15 | System.out.println("Num = " + i); 16 | } 17 | 18 | public void printString() { 19 | System.out.println("String = " + name); 20 | } 21 | } 22 | 23 | public class Interface { 24 | public static void main(String args[]) { 25 | 26 | Son son = new Son(); 27 | 28 | son.printNum(); 29 | son.printString(); 30 | } 31 | } -------------------------------------------------------------------------------- /java_learn/07th_extends/Limit.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Limit.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Person.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Son.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Son.class -------------------------------------------------------------------------------- /java_learn/07th_extends/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/07th_extends/Student.class -------------------------------------------------------------------------------- /java_learn/08th_cnv/Cnv.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/08th_cnv/Cnv.class -------------------------------------------------------------------------------- /java_learn/08th_cnv/Daughter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/08th_cnv/Daughter.class -------------------------------------------------------------------------------- /java_learn/08th_cnv/Father.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/08th_cnv/Father.class -------------------------------------------------------------------------------- /java_learn/08th_cnv/Son.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/08th_cnv/Son.class -------------------------------------------------------------------------------- /java_learn/09th_exception/Div.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/09th_exception/Div.class -------------------------------------------------------------------------------- /java_learn/10th_package/Pack.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/10th_package/Pack.class -------------------------------------------------------------------------------- /java_learn/10th_package/Pack.java: -------------------------------------------------------------------------------- 1 | import pack.jack.*; 2 | import pack.hceng.*; 3 | 4 | public class Pack { 5 | public static void main(String args[]) { 6 | System.out.println("add1:"+pack.jack.Math.add(1, 2)); 7 | System.out.println("add2:"+pack.hceng.Math.add(1, 2)); 8 | 9 | System.out.println("add2:"+pack.hceng.Math.sub(1, 2)); 10 | 11 | pack.hceng.Permission.printInfo(); //Permission.printInfo(); 12 | pack.jack.TestAccess.printInfo(); 13 | System.out.println("Accessible anywhere: d = " + Permission.d); 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /java_learn/10th_package/hceng/Math.java: -------------------------------------------------------------------------------- 1 | package pack.hceng; //打包到pack/hceng目录,生成Math.class 2 | 3 | public class Math { 4 | public static int add(int x, int y) { 5 | return x + y + 1; 6 | } 7 | 8 | public static int sub(int x, int y) { 9 | return x - y; 10 | } 11 | } -------------------------------------------------------------------------------- /java_learn/10th_package/hceng/Permission.java: -------------------------------------------------------------------------------- 1 | package pack.hceng; 2 | 3 | //一个文件中只能有一个public类,从而被外部访问 4 | public class Permission { 5 | 6 | static private int a = 1; //通过static修饰的变量叫类变量,可以不通过new创建对象进行访问 7 | static int b = 2; 8 | static protected int c = 3; 9 | static public int d = 4; 10 | 11 | public static void printInfo() { //通过static修饰的方法叫类方法,可以不通过new创建对象进行访问 12 | System.out.println("Can only be accessed by this class: a = " + a); 13 | packagePermission.printInfo(); 14 | } 15 | } 16 | 17 | //没有public的类,只能在本包访问 18 | class packagePermission { 19 | public static void printInfo() { 20 | System.out.println("Access in the same package: b = " + Permission.b); 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /java_learn/10th_package/jack/Math.java: -------------------------------------------------------------------------------- 1 | package pack.jack; 2 | 3 | public class Math { 4 | public static int add(int x, int y) { 5 | return x + y; 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /java_learn/10th_package/jack/TestAccess.java: -------------------------------------------------------------------------------- 1 | package pack.jack; 2 | import pack.hceng.Permission; 3 | 4 | public class TestAccess extends Permission { 5 | public static void printInfo() { 6 | System.out.println("Access in different packages: c = " + Permission.c); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /java_learn/10th_package/pack.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/10th_package/pack.jar -------------------------------------------------------------------------------- /java_learn/11th_Inner/A.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/A.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/Inner$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/Inner$1.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/Inner.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/Inner.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/MyInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/MyInterface.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/OutClass$InnerClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/OutClass$InnerClass.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/OutClass$InnerClass1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/OutClass$InnerClass1.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/OutClass$InnerClass2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/OutClass$InnerClass2.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/OutClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/OutClass.class -------------------------------------------------------------------------------- /java_learn/11th_Inner/PrintInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/11th_Inner/PrintInterface.class -------------------------------------------------------------------------------- /java_learn/12th_jni/1/Jni.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/12th_jni/1/Jni.class -------------------------------------------------------------------------------- /java_learn/12th_jni/1/Jni.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class Jni */ 4 | 5 | #ifndef _Included_Jni 6 | #define _Included_Jni 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: Jni 12 | * Method: hello_implicit 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_Jni_hello_1implicit 16 | (JNIEnv *, jclass); 17 | 18 | /* 19 | * Class: Jni 20 | * Method: hello_explicit 21 | * Signature: ()V 22 | */ 23 | JNIEXPORT void JNICALL Java_Jni_hello_1explicit 24 | (JNIEnv *, jclass); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /java_learn/12th_jni/1/Jni.java: -------------------------------------------------------------------------------- 1 | public class Jni { 2 | /* 1.加载 */ 3 | static { //静态代码块(只会被调用一次) 4 | System.loadLibrary("native"); //C语言会编译生成libnative.so,这里加载它 5 | } 6 | /* 2.声明 */ 7 | public native static void hello_implicit(); //声明(static静态方法,可直接调用) 8 | public native static void hello_explicit(); 9 | /* 3.调用 */ 10 | public static void main(String args[]) { 11 | hello_implicit(); 12 | hello_explicit(); 13 | } 14 | } -------------------------------------------------------------------------------- /java_learn/12th_jni/1/libnative.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/12th_jni/1/libnative.so -------------------------------------------------------------------------------- /java_learn/12th_jni/2/Jni.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/12th_jni/2/Jni.class -------------------------------------------------------------------------------- /java_learn/12th_jni/2/Jni.java: -------------------------------------------------------------------------------- 1 | public class Jni { 2 | 3 | static { 4 | System.loadLibrary("native"); 5 | } 6 | 7 | //基本类型数据 8 | public native static float typeData1(int a); 9 | 10 | //字符串 11 | public native static String typeData2(String str); 12 | 13 | //数组 14 | public native static int[] typeData3(int[] a); 15 | 16 | public static void main(String args[]) { 17 | int [] a = {1, 2, 3, 4}; 18 | int [] b = null; 19 | int i; 20 | 21 | System.out.println(typeData1(4)); 22 | System.out.println(typeData2("hceng")); 23 | 24 | b = typeData3(a); 25 | for (i = 0; i < b.length; i++) 26 | System.out.print(b[i]+" "); 27 | System.out.println(); 28 | } 29 | } -------------------------------------------------------------------------------- /java_learn/12th_jni/2/libnative.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/12th_jni/2/libnative.so -------------------------------------------------------------------------------- /java_learn/12th_jni/3/Hello.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/12th_jni/3/Hello.class -------------------------------------------------------------------------------- /java_learn/12th_jni/3/Hello.java: -------------------------------------------------------------------------------- 1 | public class Hello { 2 | private static String name; 3 | private static int age; 4 | 5 | public static void main(String args[]) { //静态方法 6 | System.out.println("java: name: "+ name + ", age: " + age); 7 | } 8 | 9 | public int typeData(String str) { //非静态方法 10 | System.out.println("java: get str: "+ str + " ,will return 100"); 11 | return 100; 12 | } 13 | } -------------------------------------------------------------------------------- /java_learn/12th_jni/3/caller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/12th_jni/3/caller -------------------------------------------------------------------------------- /java_learn/13th_generics/Generics.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Generics.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Person1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Person1.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Person2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Person2.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Person3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Person3.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Studen2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Studen2.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Student1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Student1.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Student2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Student2.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Student3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Student3.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Student4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Student4.class -------------------------------------------------------------------------------- /java_learn/13th_generics/Student5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/13th_generics/Student5.class -------------------------------------------------------------------------------- /java_learn/14th_reflect/Person.java: -------------------------------------------------------------------------------- 1 | package jack; 2 | 3 | public class Person { 4 | private String name; 5 | 6 | public void setName(String name) { 7 | this.name = name; 8 | } 9 | 10 | public String getName() { 11 | return this.name; 12 | } 13 | 14 | //构造方法 15 | public Person() { 16 | System.out.println("Constructor1 of Person"); 17 | } 18 | 19 | public Person(String name) { 20 | this.name = name; 21 | System.out.println("Constructor2 of Person, name is "+this.name); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /java_learn/14th_reflect/Student.java: -------------------------------------------------------------------------------- 1 | package jack; 2 | 3 | public class Student { 4 | public String name; 5 | 6 | public void setName(String name) { 7 | this.name = name; 8 | } 9 | 10 | public String getName() { 11 | return this.name; 12 | } 13 | 14 | //构造方法 15 | public Student() { 16 | System.out.println("Constructor1 of Student"); 17 | } 18 | 19 | public Student(String name) { 20 | this.name = name; 21 | System.out.println("Constructor2 of Student, name is "+this.name); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /java_learn/14th_reflect/hceng/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/14th_reflect/hceng/Person.class -------------------------------------------------------------------------------- /java_learn/14th_reflect/hceng/Reflect.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/14th_reflect/hceng/Reflect.class -------------------------------------------------------------------------------- /java_learn/14th_reflect/jack/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/14th_reflect/jack/Person.class -------------------------------------------------------------------------------- /java_learn/14th_reflect/jack/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/java_learn/14th_reflect/jack/Student.class -------------------------------------------------------------------------------- /kobject_test/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/hceng/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += kobject_test.o 11 | -------------------------------------------------------------------------------- /kobject_test/kobject_app.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* 13 | kobject_test 14 | */ 15 | int fd; 16 | 17 | int main(int argc, char **argv) 18 | { 19 | fd = open("/dev/kobject_test", O_RDWR); 20 | if (fd < 0) 21 | { 22 | printf("can't open!\n"); 23 | return -1; 24 | } 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /lock/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/hceng/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += lock_drv.o 11 | 12 | -------------------------------------------------------------------------------- /lock/lock_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int fd; 9 | 10 | fd = open("/dev/locktest", O_RDWR); 11 | 12 | if (fd < 0) 13 | { 14 | printf("app: can't open!\n"); 15 | } 16 | else printf("app: open ok!\n"); 17 | 18 | while(1); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /my_bootloader/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CC = arm-linux-gcc 3 | LD = arm-linux-ld 4 | AR = arm-linux-ar 5 | OBJCOPY = arm-linux-objcopy 6 | OBJDUMP = arm-linux-objdump 7 | 8 | CFLAGS := -Wall -O2 9 | CPPFLAGS := -nostdinc -nostdlib -fno-builtin 10 | 11 | objs := start.o init.o boot.o 12 | 13 | boot.bin: $(objs) 14 | ${LD} -Tboot.lds -o boot.elf $^ 15 | ${OBJCOPY} -O binary -S boot.elf $@ 16 | ${OBJDUMP} -D -m arm boot.elf > boot.dis 17 | 18 | %.o:%.c 19 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 20 | 21 | %.o:%.S 22 | ${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 23 | 24 | clean: 25 | rm -f *.o *.bin *.elf *.dis 26 | 27 | -------------------------------------------------------------------------------- /my_bootloader/boot.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/my_bootloader/boot.c -------------------------------------------------------------------------------- /my_bootloader/boot.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x33f80000; 3 | .text : { *(.text) } 4 | 5 | . = ALIGN(4); 6 | .rodata : {*(.rodata*)} 7 | 8 | . = ALIGN(4); 9 | .data : { *(.data) } 10 | . = ALIGN(4); 11 | 12 | __bss_start = .; 13 | .bss : { *(.bss) *(COMMON) } 14 | __bss_end = .; 15 | } 16 | -------------------------------------------------------------------------------- /my_bootloader/start.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/my_bootloader/start.S -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/.hello.ko.cmd: -------------------------------------------------------------------------------- 1 | cmd_/work/nano_pi/learn/1th_hello/hello.ko := arm-linux-gnueabi-ld -EL -r -T /work/nano_pi/lichee/linux-3.4/scripts/module-common.lds --build-id -o /work/nano_pi/learn/1th_hello/hello.ko /work/nano_pi/learn/1th_hello/hello.o /work/nano_pi/learn/1th_hello/hello.mod.o 2 | -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/.tmp_versions/hello.mod: -------------------------------------------------------------------------------- 1 | /work/nano_pi/learn/1th_hello/hello.ko 2 | /work/nano_pi/learn/1th_hello/hello.o 3 | -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/Makefile: -------------------------------------------------------------------------------- 1 | #KERN_DIR = /work/system/linux-3.4.2 2 | KERN_DIR = /work/nano_pi/lichee/linux-3.4 3 | 4 | all: 5 | make -C $(KERN_DIR) M=`pwd` modules 6 | 7 | clean: 8 | make -C $(KERN_DIR) M=`pwd` modules clean 9 | rm -rf modules.order 10 | 11 | obj-m += hello.o 12 | -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/Module.symvers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/1th_hello/Module.symvers -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | static int hello_init(void) 6 | { 7 | printk("Hello, world.\n"); 8 | return 0; 9 | } 10 | 11 | static void hello_exit(void) 12 | { 13 | printk("Hello, exit.\n"); 14 | } 15 | 16 | module_init(hello_init); 17 | module_exit(hello_exit); 18 | 19 | MODULE_LICENSE("Dual BSD/GPL"); 20 | -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/hello.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/1th_hello/hello.ko -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/hello.mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | MODULE_INFO(vermagic, VERMAGIC_STRING); 6 | 7 | struct module __this_module 8 | __attribute__((section(".gnu.linkonce.this_module"))) = { 9 | .name = KBUILD_MODNAME, 10 | .init = init_module, 11 | #ifdef CONFIG_MODULE_UNLOAD 12 | .exit = cleanup_module, 13 | #endif 14 | .arch = MODULE_ARCH_INIT, 15 | }; 16 | 17 | static const char __module_depends[] 18 | __used 19 | __attribute__((section(".modinfo"))) = 20 | "depends="; 21 | 22 | -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/hello.mod.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/1th_hello/hello.mod.o -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/hello.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/1th_hello/hello.o -------------------------------------------------------------------------------- /nano_pi_drv/1th_hello/modules.order: -------------------------------------------------------------------------------- 1 | kernel//work/nano_pi/learn/1th_hello/hello.ko 2 | -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/.led_drv.ko.cmd: -------------------------------------------------------------------------------- 1 | cmd_/work/nano_pi/learn/2th_led/led_drv.ko := arm-linux-gnueabi-ld -EL -r -T /work/nano_pi/lichee/linux-3.4/scripts/module-common.lds --build-id -o /work/nano_pi/learn/2th_led/led_drv.ko /work/nano_pi/learn/2th_led/led_drv.o /work/nano_pi/learn/2th_led/led_drv.mod.o 2 | -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/.tmp_versions/led_drv.mod: -------------------------------------------------------------------------------- 1 | /work/nano_pi/learn/2th_led/led_drv.ko 2 | /work/nano_pi/learn/2th_led/led_drv.o 3 | -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/nano_pi/lichee/linux-3.4 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += led_drv.o 11 | -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/Module.symvers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/2th_led/Module.symvers -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/led_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/2th_led/led_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/led_drv.mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | MODULE_INFO(vermagic, VERMAGIC_STRING); 6 | 7 | struct module __this_module 8 | __attribute__((section(".gnu.linkonce.this_module"))) = { 9 | .name = KBUILD_MODNAME, 10 | .init = init_module, 11 | #ifdef CONFIG_MODULE_UNLOAD 12 | .exit = cleanup_module, 13 | #endif 14 | .arch = MODULE_ARCH_INIT, 15 | }; 16 | 17 | static const char __module_depends[] 18 | __used 19 | __attribute__((section(".modinfo"))) = 20 | "depends="; 21 | 22 | -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/led_drv.mod.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/2th_led/led_drv.mod.o -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/led_drv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/2th_led/led_drv.o -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/led_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/2th_led/led_test -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/led_test.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* 8 | led_test on 9 | led_test off 10 | */ 11 | int main(int argc, char **argv) 12 | { 13 | int fd; 14 | int val = 1; 15 | fd = open("/dev/led", O_RDWR); 16 | if (fd < 0) 17 | { 18 | printf("can't open!\n"); 19 | } 20 | if (argc != 2) 21 | { 22 | printf("Usage :\n"); 23 | printf("%s \n", argv[0]); 24 | return 0; 25 | } 26 | 27 | if (strcmp(argv[1], "on") == 0) 28 | { 29 | printf("on\n"); 30 | val = 1; 31 | } 32 | else 33 | { 34 | printf("off\n"); 35 | 36 | val = 0; 37 | } 38 | 39 | write(fd, &val, 4); 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /nano_pi_drv/2th_led/modules.order: -------------------------------------------------------------------------------- 1 | kernel//work/nano_pi/learn/2th_led/led_drv.ko 2 | -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/nano_pi/lichee/linux-3.4 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += button_drv.o 11 | -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/Module.symvers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/3th_button/Module.symvers -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/button_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/3th_button/button_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/button_drv.mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | MODULE_INFO(vermagic, VERMAGIC_STRING); 6 | 7 | struct module __this_module 8 | __attribute__((section(".gnu.linkonce.this_module"))) = { 9 | .name = KBUILD_MODNAME, 10 | .init = init_module, 11 | #ifdef CONFIG_MODULE_UNLOAD 12 | .exit = cleanup_module, 13 | #endif 14 | .arch = MODULE_ARCH_INIT, 15 | }; 16 | 17 | static const char __module_depends[] 18 | __used 19 | __attribute__((section(".modinfo"))) = 20 | "depends="; 21 | 22 | -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/button_drv.mod.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/3th_button/button_drv.mod.o -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/button_drv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/3th_button/button_drv.o -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/button_test.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* 8 | read button PA3 9 | */ 10 | int main(int argc, char **argv) 11 | { 12 | int fd; 13 | unsigned int key_val = 0; 14 | unsigned int key_count = 0; 15 | 16 | fd = open("/dev/button", O_RDWR); 17 | if (fd < 0) 18 | { 19 | printf("can't open!\n"); 20 | } 21 | 22 | while(1) 23 | { 24 | read(fd, &key_val, 4); 25 | if(key_val == 1) 26 | { 27 | printf("key_count = %d. \n", key_count++); 28 | } 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /nano_pi_drv/3th_button/modules.order: -------------------------------------------------------------------------------- 1 | kernel//work/nano_pi/learn/3th_button/button_drv.ko 2 | -------------------------------------------------------------------------------- /nano_pi_drv/4th_irq/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/nano_pi/lichee/linux-3.4 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += button_irq_drv.o 11 | -------------------------------------------------------------------------------- /nano_pi_drv/4th_irq/button_irq_drv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/4th_irq/button_irq_drv.o -------------------------------------------------------------------------------- /nano_pi_drv/4th_irq/button_irq_test.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* 8 | read button PA3 9 | */ 10 | int main(int argc, char **argv) 11 | { 12 | int fd; 13 | unsigned int key_val = 0; 14 | unsigned int key_count = 0; 15 | 16 | fd = open("/dev/button", O_RDWR); 17 | if (fd < 0) 18 | { 19 | printf("can't open!\n"); 20 | } 21 | 22 | while(1) 23 | { 24 | read(fd, &key_val, 4); 25 | if(key_val == 1) 26 | { 27 | printf("key_count = %d. \n", key_count++); 28 | } 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /nano_pi_drv/4th_irq/led_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/4th_irq/led_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/5th_poll/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/nano_pi/lichee/linux-3.4 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += button_irq_poll_drv.o 11 | -------------------------------------------------------------------------------- /nano_pi_drv/5th_poll/button_irq_poll_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/5th_poll/button_irq_poll_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/5th_poll/button_led_irq_poll_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/5th_poll/button_led_irq_poll_test -------------------------------------------------------------------------------- /nano_pi_drv/5th_poll/button_led_irq_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/5th_poll/button_led_irq_test -------------------------------------------------------------------------------- /nano_pi_drv/5th_poll/led_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/5th_poll/led_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/6th_fasync/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/nano_pi/lichee/linux-3.4 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += button_irq_fasync_drv.o 11 | -------------------------------------------------------------------------------- /nano_pi_drv/6th_fasync/button_irq_fasync_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/6th_fasync/button_irq_fasync_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/6th_fasync/button_led_irq_fasync_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/6th_fasync/button_led_irq_fasync_test -------------------------------------------------------------------------------- /nano_pi_drv/6th_fasync/button_led_irq_poll_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/6th_fasync/button_led_irq_poll_test -------------------------------------------------------------------------------- /nano_pi_drv/6th_fasync/button_led_irq_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/6th_fasync/button_led_irq_test -------------------------------------------------------------------------------- /nano_pi_drv/6th_fasync/led_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/6th_fasync/led_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/7th_sem/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/nano_pi/lichee/linux-3.4 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += button_irq_fasync_sem_drv.o 11 | -------------------------------------------------------------------------------- /nano_pi_drv/7th_sem/button_irq_fasync_sem_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/7th_sem/button_irq_fasync_sem_drv.ko -------------------------------------------------------------------------------- /nano_pi_drv/7th_sem/button_led_irq_fasync_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/7th_sem/button_led_irq_fasync_test -------------------------------------------------------------------------------- /nano_pi_drv/7th_sem/button_led_irq_poll_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/7th_sem/button_led_irq_poll_test -------------------------------------------------------------------------------- /nano_pi_drv/7th_sem/button_led_irq_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/7th_sem/button_led_irq_test -------------------------------------------------------------------------------- /nano_pi_drv/7th_sem/led_drv.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/nano_pi_drv/7th_sem/led_drv.ko -------------------------------------------------------------------------------- /push.bat: -------------------------------------------------------------------------------- 1 | git add . && git commit -m "auto" && git push 2 | -------------------------------------------------------------------------------- /rk3288/hardware/1_led/Readme: -------------------------------------------------------------------------------- 1 | cd code; make; cd -; 2 | 3 | ./boot_merger rk3288.ini -------------------------------------------------------------------------------- /rk3288/hardware/1_led/boot_merger: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/1_led/boot_merger -------------------------------------------------------------------------------- /rk3288/hardware/1_led/code/Makefile: -------------------------------------------------------------------------------- 1 | PREFIX=arm-none-linux-gnueabi- 2 | CC=$(PREFIX)gcc 3 | LD=$(PREFIX)ld 4 | AR=$(PREFIX)ar 5 | OBJCOPY=$(PREFIX)objcopy 6 | OBJDUMP=$(PREFIX)objdump 7 | 8 | rk3288.bin : start.S led.c main.c 9 | $(CC) -nostdlib -g -c -o start.o start.S 10 | $(CC) -nostdlib -g -c -o led.o led.c 11 | $(CC) -nostdlib -g -c -o main.o main.c 12 | 13 | $(LD) -Trk3288.lds -g start.o led.o main.o -o rk3288_elf 14 | 15 | $(OBJCOPY) -O binary -S rk3288_elf rk3288.bin 16 | $(OBJDUMP) -D -m arm rk3288_elf > rk3288.dis 17 | 18 | clean: 19 | rm -f rk3288.dis rk3288.bin rk3288_elf *.o 20 | 21 | 22 | -------------------------------------------------------------------------------- /rk3288/hardware/1_led/code/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/1_led/code/led.c -------------------------------------------------------------------------------- /rk3288/hardware/1_led/code/led.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __LED_H__ 3 | #define __LED_H__ 4 | 5 | extern void led_mode(int mode); 6 | extern void delay(unsigned int i); 7 | extern void test_ddr(void); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /rk3288/hardware/1_led/code/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include "led.h" 3 | 4 | 5 | int main() 6 | { 7 | led_mode(6); 8 | delay(1000000); 9 | 10 | while(1); 11 | 12 | return 0; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /rk3288/hardware/1_led/code/rk3288.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x90000; /* 0xFF700000;*/ 3 | .text : { start.o(.text) 4 | main.o(.text) 5 | led.o(.text) 6 | *(.text) 7 | } 8 | .rodata ALIGN(4) : {*(.rodata*)} 9 | .data ALIGN(4) : { *(.data) } 10 | __bss_start = .; 11 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 12 | __bss_end = .; 13 | } 14 | -------------------------------------------------------------------------------- /rk3288/hardware/1_led/code/start.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/1_led/code/start.S -------------------------------------------------------------------------------- /rk3288/hardware/1_led/rk3288.ini: -------------------------------------------------------------------------------- 1 | [CHIP_NAME] 2 | NAME=RK320A 3 | [VERSION] 4 | MAJOR=2 5 | MINOR=30 6 | [CODE471_OPTION] 7 | NUM=1 8 | Path1=./tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin 9 | Sleep=1 10 | [CODE472_OPTION] 11 | NUM=1 12 | Path1=./tool/rk32xxusbplug.bin 13 | [LOADER_OPTION] 14 | NUM=2 15 | LOADER1=FlashData 16 | LOADER2=FlashBoot 17 | FlashData=./tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin 18 | FlashBoot=./code/rk3288.bin 19 | [OUTPUT] 20 | PATH=rk3288_emmc.bin 21 | -------------------------------------------------------------------------------- /rk3288/hardware/1_led/tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/1_led/tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin -------------------------------------------------------------------------------- /rk3288/hardware/1_led/tool/rk32xxusbplug.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/1_led/tool/rk32xxusbplug.bin -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/Readme: -------------------------------------------------------------------------------- 1 | cd code; make; cd -; 2 | 3 | ./boot_merger rk3288.ini -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/boot_merger: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/2_uart/boot_merger -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/2_uart/code/led.c -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/led.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __LED_H__ 3 | #define __LED_H__ 4 | 5 | extern void led_mode(int mode); 6 | extern void delay(unsigned int i); 7 | extern void test_ddr(void); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include "led.h" 3 | #include "uart.h" 4 | 5 | int raise (int sig_nr) 6 | { 7 | return 0; 8 | } 9 | 10 | int main(void) 11 | { 12 | led_mode(3); 13 | 14 | uart_init(); 15 | 16 | while(1) 17 | { 18 | printf_test(); 19 | 20 | delay(10000000); 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/printf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PRINTF_H 3 | #define _PRINTF_H 4 | 5 | #include "uart.h" 6 | #define __out_putchar rk_uart_sendbyte 7 | 8 | 9 | #define MAX_NUMBER_BYTES 64 10 | extern int printf_test(void); 11 | int printf(const char *fmt, ...); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/rk3288.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x70000000; /* DDR:0~0x80000000*/ 3 | .text : { start.o(.text) 4 | main.o(.text) 5 | led.o(.text) 6 | uart.o(.text) 7 | *(.text) 8 | } 9 | .rodata ALIGN(4) : {*(.rodata*)} 10 | .data ALIGN(4) : { *(.data) } 11 | __bss_start = .; 12 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 13 | __bss_end = .; 14 | } 15 | -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/start.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/2_uart/code/start.S -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/uart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/2_uart/code/uart.c -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/code/uart.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __UART_H__ 3 | #define __UART_H__ 4 | 5 | void uart_init(void); 6 | void rk_uart_sendbyte(unsigned char byte); 7 | void rk_uart_sendstring(char *ptr); 8 | void rk_uart_sendhex(unsigned int val); 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/rk3288.ini: -------------------------------------------------------------------------------- 1 | [CHIP_NAME] 2 | NAME=RK320A 3 | [VERSION] 4 | MAJOR=2 5 | MINOR=30 6 | [CODE471_OPTION] 7 | NUM=1 8 | Path1=./tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin 9 | Sleep=1 10 | [CODE472_OPTION] 11 | NUM=1 12 | Path1=./tool/rk32xxusbplug.bin 13 | [LOADER_OPTION] 14 | NUM=2 15 | LOADER1=FlashData 16 | LOADER2=FlashBoot 17 | FlashData=./tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin 18 | FlashBoot=./code/rk3288.bin 19 | [OUTPUT] 20 | PATH=rk3288_emmc.bin 21 | -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/2_uart/tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin -------------------------------------------------------------------------------- /rk3288/hardware/2_uart/tool/rk32xxusbplug.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/2_uart/tool/rk32xxusbplug.bin -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/Readme: -------------------------------------------------------------------------------- 1 | cd code; make; cd -; 2 | 3 | ./boot_merger rk3288.ini -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/boot_merger: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/boot_merger -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/int.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/code/int.c -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/key.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/code/key.c -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/code/led.c -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/led.h: -------------------------------------------------------------------------------- 1 | #ifndef __LED_H__ 2 | #define __LED_H__ 3 | 4 | #define GPIO8 0xFF7F0000 //P37 5 | #define GPIO8_SWPORTA_DR (*(volatile unsigned long *)(GPIO8 + 0x04*0)) //1580 Port A data register 6 | #define GPIO8_SWPORTA_DDR (*(volatile unsigned long *)(GPIO8 + 0x04*1)) //1580 Port A data direction register 7 | 8 | 9 | extern void led_mode(int mode); 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include "led.h" 3 | #include "int.h" 4 | #include "key.h" 5 | #include "timer.h" 6 | #include "uart.h" 7 | #include "printf.h" 8 | 9 | void irq_test_printf(void) 10 | { 11 | printf("irq_test_printf!\n\r"); 12 | } 13 | 14 | int main(void) 15 | { 16 | led_mode(3); 17 | 18 | uart_init(); 19 | printf("eMMC boot!\n\r"); 20 | 21 | gic_irq_init(); 22 | printf("interrupt init ok!\n\r"); 23 | 24 | key_test_interrupt(); 25 | 26 | timer_test_interrupt(); 27 | 28 | while(1) 29 | { 30 | 31 | } 32 | 33 | return 0; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/printf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PRINTF_H 3 | #define _PRINTF_H 4 | 5 | #include "uart.h" 6 | #define __out_putchar rk_uart_sendbyte 7 | 8 | #define MAX_NUMBER_BYTES 64 9 | int printf_test(void); 10 | int printf(const char *fmt, ...); 11 | int raise (int sig_nr); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/rk3288.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x70000000; 3 | .text : { start.o(.text) 4 | main.o(.text) 5 | led.o(.text) 6 | uart.o(.text) 7 | *(.text) 8 | } 9 | .rodata ALIGN(4) : {*(.rodata*)} 10 | .data ALIGN(4) : { *(.data) } 11 | __bss_start = .; 12 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 13 | __bss_end = .; 14 | } 15 | -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/timer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/code/timer.c -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMER_H__ 2 | #define __TIMER_H__ 3 | 4 | #define REG1 (*(volatile unsigned long *)( 0xFF6B0000 + 0x20 * 3 + 0x08)) 5 | #define REG2 (*(volatile unsigned long *)( 0xFF6B0000 + 0x20 * 3 + 0x00)) 6 | #define REG3 (*(volatile unsigned long *)( 0xFF6B0000 + 0x20 * 3 + 0x10)) 7 | #define REG4 (*(volatile unsigned long *)( 0xFF6B0000 + 0x20 * 3 + 0x18)) 8 | 9 | extern void delay(unsigned int i); 10 | extern void timer_test_interrupt(void); 11 | 12 | #endif -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/code/uart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/code/uart.c -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/rk3288.ini: -------------------------------------------------------------------------------- 1 | [CHIP_NAME] 2 | NAME=RK320A 3 | [VERSION] 4 | MAJOR=2 5 | MINOR=30 6 | [CODE471_OPTION] 7 | NUM=1 8 | Path1=./tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin 9 | Sleep=1 10 | [CODE472_OPTION] 11 | NUM=1 12 | Path1=./tool/rk32xxusbplug.bin 13 | [LOADER_OPTION] 14 | NUM=2 15 | LOADER1=FlashData 16 | LOADER2=FlashBoot 17 | FlashData=./tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin 18 | FlashBoot=./code/rk3288.bin 19 | [OUTPUT] 20 | PATH=rk3288_emmc.bin 21 | -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/tool/32_LPDDR2_200MHz_LPDDR3_200MHz_DDR3_200MHz_20160530.bin -------------------------------------------------------------------------------- /rk3288/hardware/3_irq/tool/rk32xxusbplug.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/3_irq/tool/rk32xxusbplug.bin -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/int.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/lvds/int.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/key.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/lvds/key.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/lcd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/lvds/lcd.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/lvds/led.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/led.h: -------------------------------------------------------------------------------- 1 | #ifndef __LED_H__ 2 | #define __LED_H__ 3 | 4 | #define GPIO8 0xFF7F0000 //P37 5 | #define GPIO8_SWPORTA_DR (*(volatile unsigned long *)(GPIO8 + 0x04*0)) //1580 Port A data register 6 | #define GPIO8_SWPORTA_DDR (*(volatile unsigned long *)(GPIO8 + 0x04*1)) //1580 Port A data direction register 7 | 8 | 9 | extern void led_mode(int mode); 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include "led.h" 3 | #include "int.h" 4 | #include "key.h" 5 | #include "timer.h" 6 | #include "uart.h" 7 | #include "printf.h" 8 | 9 | int main(void) 10 | { 11 | uart_init(); 12 | printf("hardware test!\n\r"); 13 | 14 | //gic_irq_init(); 15 | //printf("interrupt init ok!\n\r"); 16 | 17 | //key_test_interrupt(); 18 | 19 | //timer_test_interrupt(); 20 | 21 | lcd_test(); 22 | 23 | 24 | while(0) 25 | { 26 | led_mode(1); 27 | delay_s(1); 28 | led_mode(0); 29 | delay_s(1); 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/printf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PRINTF_H 3 | #define _PRINTF_H 4 | 5 | #include "uart.h" 6 | #define __out_putchar rk_uart_sendbyte 7 | 8 | #define MAX_NUMBER_BYTES 64 9 | int printf_test(void); 10 | int printf(const char *fmt, ...); 11 | int raise (int sig_nr); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/rk3288.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x40000000; 3 | .text : { start.o(.text) 4 | main.o(.text) 5 | led.o(.text) 6 | uart.o(.text) 7 | *(.text) 8 | } 9 | .rodata ALIGN(4) : {*(.rodata*)} 10 | .data ALIGN(4) : { *(.data) } 11 | __bss_start = .; 12 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 13 | __bss_end = .; 14 | } 15 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/timer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/lvds/timer.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/uart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/lvds/uart.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/lvds/分析.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/lvds/分析.txt -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/int.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/mipi/int.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/key.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/mipi/key.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/lcd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/mipi/lcd.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/mipi/led.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/led.h: -------------------------------------------------------------------------------- 1 | #ifndef __LED_H__ 2 | #define __LED_H__ 3 | 4 | #define GPIO8 0xFF7F0000 //P37 5 | #define GPIO8_SWPORTA_DR (*(volatile unsigned long *)(GPIO8 + 0x04*0)) //1580 Port A data register 6 | #define GPIO8_SWPORTA_DDR (*(volatile unsigned long *)(GPIO8 + 0x04*1)) //1580 Port A data direction register 7 | 8 | //SDIO0_WP/GPIO4_D3_d 9 | #define GPIO4 0xFF7B0000 10 | #define GPIO4_SWPORTA_DR (*(volatile unsigned long *)(GPIO4 + 0x04*0)) //1580 Port A data register 11 | #define GPIO4_SWPORTA_DDR (*(volatile unsigned long *)(GPIO4 + 0x04*1)) //1580 Port A data direction register 12 | 13 | extern void led_mode(int mode); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include "led.h" 3 | #include "int.h" 4 | #include "key.h" 5 | #include "timer.h" 6 | #include "uart.h" 7 | #include "printf.h" 8 | 9 | int main(void) 10 | { 11 | uart_init(); 12 | printf("hardware test!\n\r"); 13 | 14 | //gic_irq_init(); 15 | //printf("interrupt init ok!\n\r"); 16 | 17 | //key_test_interrupt(); 18 | 19 | //timer_test_interrupt(); 20 | 21 | lcd_test(); 22 | 23 | 24 | while(1) 25 | { 26 | led_mode(2); 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/printf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PRINTF_H 3 | #define _PRINTF_H 4 | 5 | #include "uart.h" 6 | #define __out_putchar rk_uart_sendbyte 7 | 8 | #define MAX_NUMBER_BYTES 64 9 | int printf_test(void); 10 | int printf(const char *fmt, ...); 11 | int raise (int sig_nr); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/rk3288.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | . = 0x40000000; 3 | .text : { start.o(.text) 4 | main.o(.text) 5 | led.o(.text) 6 | uart.o(.text) 7 | *(.text) 8 | } 9 | .rodata ALIGN(4) : {*(.rodata*)} 10 | .data ALIGN(4) : { *(.data) } 11 | __bss_start = .; 12 | .bss ALIGN(4) : { *(.bss) *(COMMON) } 13 | __bss_end = .; 14 | } 15 | -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/timer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/mipi/timer.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/uart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/mipi/uart.c -------------------------------------------------------------------------------- /rk3288/hardware/4_lcd/mipi/分析.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/rk3288/hardware/4_lcd/mipi/分析.txt -------------------------------------------------------------------------------- /semaphore/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/hceng/linux-3.4.2 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += semaphore_drv.o 11 | 12 | -------------------------------------------------------------------------------- /semaphore/semaphore_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int fd; 9 | 10 | fd = open("/dev/semaphoretest", O_RDWR); 11 | 12 | if (fd < 0) 13 | { 14 | printf("app: can't open!\n"); 15 | } 16 | else printf("app: open ok!\n"); 17 | 18 | while(1); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /shell/hceng_am437x_create_MLO.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/shell/hceng_am437x_create_MLO.sh -------------------------------------------------------------------------------- /shell/hceng_am437x_debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #add this shell script to /etc/profile 4 | 5 | #hceng add for drv_debug. 6 | tail -f /var/log/messages & 7 | 8 | #hceng add for close GUI. 9 | program=`ps | grep -v grep | grep matrix_browser` 10 | if ["$program" = ""] 11 | then 12 | exit 13 | else 14 | /etc/init.d/matrix-gui-2.0 stop 15 | fi 16 | -------------------------------------------------------------------------------- /ss/APP/Shadowrocket(freeluffy).ipa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/ss/APP/Shadowrocket(freeluffy).ipa -------------------------------------------------------------------------------- /ss/SSPort/autostart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #chkconfig: 2345 80 90 3 | #description:auto_run 4 | 5 | nohup /usr/local/python3/bin/python3 -u /root/SSPort.py > /root/SSPort.log 2>&1 & 6 | 7 | -------------------------------------------------------------------------------- /ss/SSPort/config.ini: -------------------------------------------------------------------------------- 1 | [APPConfig] 2 | Intervals = 60 3 | SendMAX = 3 4 | ServerIP = xx 5 | ServerPort = none 6 | SSConfigPath = /etc/shadowsocks-python/config.json 7 | 8 | [WebConfig] 9 | InternalURL = https://www.toolsdaquan.com/toolapi/public/ipchecking/ 10 | ForeignURL = https://www.toolsdaquan.com/toolapi/public/ipchecking2/ 11 | Referer = https://www.toolsdaquan.com/ipcheck/ 12 | InternalICMP = none 13 | InternalTCP = none 14 | ForeignICMP = none 15 | ForeignTCP = none 16 | 17 | [MailConfig] 18 | SMTPHost = smtp.qq.com 19 | FromMail = xx@qq.com 20 | Password = xxxxxx 21 | ToMail = xx@163.com,xx@qq.com 22 | Subject = none 23 | Content = none 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tiny4412/01_backlight_drv/app.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #define msleep(x) usleep(x*1000) 7 | 8 | int main(int argc, char **argv) 9 | { 10 | int fd; 11 | int val; 12 | 13 | if (argc != 2) 14 | { 15 | printf("%s+val\n",argv[0]); 16 | return -1; 17 | } 18 | 19 | fd = open("/dev/tiny4412_backlight", O_RDWR); 20 | 21 | if (fd < 0) 22 | { 23 | printf("can't open /dev/tiny4412_backlight\n"); 24 | return 0; 25 | } 26 | val = strtoul(argv[1], NULL, 0); 27 | 28 | printf("app: val = %d",val); 29 | 30 | write(fd, &val, 1); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /tiny4412/02_lcd_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/linux-4.13.9 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order app 9 | 10 | obj-m += lcd_drv.o 11 | 12 | app: 13 | arm-none-linux-gnueabi-gcc -o app app.c 14 | -------------------------------------------------------------------------------- /tiny4412/02_lcd_drv/libjpeg_new/jpg_rgb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/02_lcd_drv/libjpeg_new/jpg_rgb -------------------------------------------------------------------------------- /tiny4412/02_lcd_drv/libjpeg_new/jpg_rgb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/02_lcd_drv/libjpeg_new/jpg_rgb.c -------------------------------------------------------------------------------- /tiny4412/02_lcd_drv/libjpeg_new/libjpeg-turbo-1.5.3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/02_lcd_drv/libjpeg_new/libjpeg-turbo-1.5.3.tar.gz -------------------------------------------------------------------------------- /tiny4412/03_touchscreen/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/linux-4.13.9 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order app 9 | 10 | obj-m += edt-ft5x06.o 11 | 12 | app: 13 | arm-none-linux-gnueabi-gcc -o app app.c 14 | -------------------------------------------------------------------------------- /tiny4412/04_power_management/regulator/regulator_process.txt: -------------------------------------------------------------------------------- 1 | /*linux-4.13.9*/ 2 | 先获取regulator: 3 | devm_regulator_get (drivers\regulator\devres.c) 4 | _regulator_get (drivers\regulator\core.c) 5 | regulator_dev_lookup 6 | of_get_regulator //首先在dts里查找 7 | list_for_each_entry //如果在dts没找到,再尝试通过C文件方式查找 8 | 9 | 10 | -------------------------------------------------------------------------------- /tiny4412/04_power_management/regulator/use_dts/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/linux-4.13.9 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += regulator.o 11 | obj-m += lcd_drv.o 12 | 13 | 14 | -------------------------------------------------------------------------------- /tiny4412/04_power_management/regulator/use_machine/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/linux-4.13.9 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += backlight_drv.o 11 | obj-m += machine.o 12 | obj-m += regulator.o 13 | obj-m += lcd_drv.o -------------------------------------------------------------------------------- /tiny4412/04_power_management/runtime/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/linux-4.13.9 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order app 9 | 10 | obj-m += button_interrupt.o 11 | obj-m += lcd_drv.o 12 | obj-m += backlight_drv.o 13 | 14 | app: 15 | arm-none-linux-gnueabi-gcc -o app app.c 16 | -------------------------------------------------------------------------------- /tiny4412/04_power_management/runtime/cq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/04_power_management/runtime/cq.jpg -------------------------------------------------------------------------------- /tiny4412/04_power_management/runtime/jpg_rgb_noset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/04_power_management/runtime/jpg_rgb_noset -------------------------------------------------------------------------------- /tiny4412/04_power_management/suspend/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/linux-4.13.9 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += button_interrupt.o 11 | obj-m += lcd_drv.o 12 | obj-m += backlight_drv.o 13 | 14 | app: 15 | arm-none-linux-gnueabi-gcc -o app app.c 16 | -------------------------------------------------------------------------------- /tiny4412/04_power_management/suspend/app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/04_power_management/suspend/app -------------------------------------------------------------------------------- /tiny4412/06_irda/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /work/linux-4.13.9 2 | 3 | rc-core-objs := rc-main.o rc-ir-raw.o 4 | 5 | all: 6 | make -C $(KERN_DIR) M=`pwd` modules 7 | 8 | clean: 9 | make -C $(KERN_DIR) M=`pwd` modules clean 10 | rm -rf modules.order 11 | 12 | obj-m += rc-hceng-nec.o 13 | obj-$(CONFIG_IR_GPIO_CIR) += gpio-ir-recv.o 14 | 15 | 16 | -------------------------------------------------------------------------------- /tiny4412/06_irda/app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/06_irda/app -------------------------------------------------------------------------------- /tiny4412/07_vivid/kernel_viivd/v4l2_core/v4l2-dv-timings.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/07_vivid/kernel_viivd/v4l2_core/v4l2-dv-timings.ko -------------------------------------------------------------------------------- /tiny4412/07_vivid/kernel_viivd/v4l2_core/videobuf-core.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/07_vivid/kernel_viivd/v4l2_core/videobuf-core.ko -------------------------------------------------------------------------------- /tiny4412/07_vivid/kernel_viivd/v4l2_core/videobuf-vmalloc.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/07_vivid/kernel_viivd/v4l2_core/videobuf-vmalloc.ko -------------------------------------------------------------------------------- /tiny4412/07_vivid/kernel_viivd/vivid_drv/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /usr/src/linux-headers-4.4.0-116-generic 2 | 3 | vivid-objs := vivid-core.o vivid-ctrls.o vivid-vid-common.o vivid-vbi-gen.o \ 4 | vivid-vid-cap.o vivid-vid-out.o vivid-kthread-cap.o vivid-kthread-out.o \ 5 | vivid-radio-rx.o vivid-radio-tx.o vivid-radio-common.o \ 6 | vivid-rds-gen.o vivid-sdr-cap.o vivid-vbi-cap.o vivid-vbi-out.o \ 7 | vivid-osd.o vivid-tpg.o vivid-tpg-colors.o 8 | 9 | all: 10 | make -C $(KERN_DIR) M=`pwd` modules 11 | 12 | clean: 13 | make -C $(KERN_DIR) M=`pwd` modules clean 14 | rm -rf modules.order 15 | 16 | obj-$(CONFIG_VIDEO_VIVID) += vivid.o 17 | -------------------------------------------------------------------------------- /tiny4412/07_vivid/kernel_viivd/vivid_drv/xawtv.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/07_vivid/kernel_viivd/vivid_drv/xawtv.log -------------------------------------------------------------------------------- /tiny4412/07_vivid/my_vivid/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /usr/src/linux-headers-4.4.0-116-generic 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += my_vivid.o 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tiny4412/08_uvc/kernel_uvc/Kconfig: -------------------------------------------------------------------------------- 1 | config USB_VIDEO_CLASS 2 | tristate "USB Video Class (UVC)" 3 | depends on VIDEO_V4L2 4 | select VIDEOBUF2_VMALLOC 5 | ---help--- 6 | Support for the USB Video Class (UVC). Currently only video 7 | input devices, such as webcams, are supported. 8 | 9 | For more information see: 10 | 11 | config USB_VIDEO_CLASS_INPUT_EVDEV 12 | bool "UVC input events device support" 13 | default y 14 | depends on USB_VIDEO_CLASS 15 | depends on USB_VIDEO_CLASS=INPUT || INPUT=y 16 | ---help--- 17 | This option makes USB Video Class devices register an input device 18 | to report button events. 19 | 20 | If you are in doubt, say Y. 21 | -------------------------------------------------------------------------------- /tiny4412/08_uvc/kernel_uvc/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /usr/src/linux-headers-4.4.0-116-generic 2 | 3 | uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \ 4 | uvc_status.o uvc_isight.o uvc_debugfs.o 5 | all: 6 | make -C $(KERN_DIR) M=`pwd` modules 7 | 8 | clean: 9 | make -C $(KERN_DIR) M=`pwd` modules clean 10 | rm -rf modules.order 11 | 12 | ifeq ($(CONFIG_MEDIA_CONTROLLER),y) 13 | uvcvideo-objs += uvc_entity.o 14 | endif 15 | obj-$(CONFIG_USB_VIDEO_CLASS) += uvcvideo.o 16 | 17 | -------------------------------------------------------------------------------- /tiny4412/08_uvc/my_uvc/Makefile: -------------------------------------------------------------------------------- 1 | KERN_DIR = /usr/src/linux-headers-4.4.0-119-generic 2 | 3 | all: 4 | make -C $(KERN_DIR) M=`pwd` modules 5 | 6 | clean: 7 | make -C $(KERN_DIR) M=`pwd` modules clean 8 | rm -rf modules.order 9 | 10 | obj-m += my_uvc.o 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/app_code/convert/Makefile: -------------------------------------------------------------------------------- 1 | # 1.指定当前目录下需要编进程序去的文件 2 | obj-y += color.o 3 | obj-y += yuv2rgb.o 4 | obj-y += rgb2rgb.o 5 | obj-y += mjpeg2rgb.o 6 | obj-y += jdatasrc-tj.o 7 | obj-y += convert_manager.o -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/app_code/display/Makefile: -------------------------------------------------------------------------------- 1 | obj-y += disp_manager.o 2 | obj-y += lcd.o -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/app_code/include/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONFIG_H 2 | #define _CONFIG_H 3 | 4 | #include 5 | #include 6 | 7 | #define __DEBUG__ 8 | #ifdef __DEBUG__ 9 | #define printf_debug(format,...) printf("File: "__FILE__", Line: %05d: "format"/n", __LINE__, ##__VA_ARGS__) 10 | #else 11 | #define printf_debug(format,...) /* do nothing */ 12 | #endif 13 | 14 | 15 | #define VIDEO_DEVICE_NAME "/dev/video0" 16 | #define FB_DEVICE_NAME "/dev/fb0" 17 | 18 | #endif -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/app_code/include/process.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PROCESS_H 3 | #define _PROCESS_H 4 | 5 | #include 6 | 7 | int pic_merge(int x, int y, p_pixel_datas small_pic, p_pixel_datas big_pic); 8 | int pic_merge_region(int start_x_new_pic, int start_y_new_pic, int start_x_old_pic, int start_y_old_pic, 9 | int width, int height, p_pixel_datas new_pic, p_pixel_datas old_pic); 10 | int pic_zoom(p_pixel_datas origin_pic, p_pixel_datas zoom_pic); 11 | 12 | 13 | #endif /* _RENDER_H */ 14 | 15 | 16 | -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/app_code/process/Makefile: -------------------------------------------------------------------------------- 1 | 2 | obj-y += merge.o 3 | obj-y += zoom.o -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/app_code/video/Makefile: -------------------------------------------------------------------------------- 1 | 2 | obj-y += v4l2.o 3 | obj-y += video_manager.o -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/driver/hceng_drv/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Backlight && LCD && UVC device configuration 3 | # 4 | 5 | menu "Hceng add driver" 6 | config BACKLIGHT 7 | tristate "Backlight support" 8 | default y 9 | help 10 | This is backlight driver to tiny4412 from hceng. 11 | 12 | config LCD 13 | tristate "LCD support" 14 | depends on BACKLIGHT 15 | default y 16 | help 17 | This is LCD driver to tiny4412 from hceng. 18 | 19 | config UVC 20 | tristate "UVC support" 21 | depends on BACKLIGHT && LCD 22 | default y 23 | help 24 | This is UVC driver to tiny4412 from hceng. 25 | 26 | endmenu 27 | -------------------------------------------------------------------------------- /tiny4412/09_video2lcd/driver/hceng_drv/Makefile: -------------------------------------------------------------------------------- 1 | 2 | obj-$(CONFIG_BACKLIGHT) += backlight_drv.o 3 | obj-$(CONFIG_LCD) += lcd_drv.o 4 | obj-$(CONFIG_UVC) += uvc_drv.o -------------------------------------------------------------------------------- /tiny4412/10_usb_wifi/rootfs/etc/dhcpcd.conf: -------------------------------------------------------------------------------- 1 | subnet 192.168.2.0 netmask 255.255.255.0 { 2 | range 192.168.2.10 192.168.2.100; 3 | option domain-name-servers 192.168.2.1; 4 | option routers 192.168.2.1; 5 | } 6 | -------------------------------------------------------------------------------- /tiny4412/10_usb_wifi/rootfs/etc/hostapd.conf: -------------------------------------------------------------------------------- 1 | ctrl_interface=/var/run/hostapd 2 | 3 | ssid=hceng 4 | hw_mode=g 5 | channel=1 6 | interface=wlan0 7 | #bridge=br0 8 | driver=nl80211 9 | macaddr_acl=0 10 | #accept_mac_file=/etc/hostapd.accept 11 | #deny_mac_file=/etc/hostapd.deny 12 | 13 | auth_algs=1 14 | wpa=3 15 | wpa_passphrase=12345678 16 | wpa_key_mgmt=WPA-PSK 17 | wpa_pairwise=TKIP 18 | rsn_pairwise=CCMP 19 | 20 | -------------------------------------------------------------------------------- /tiny4412/10_usb_wifi/rootfs/etc/wpa_supplicant.conf: -------------------------------------------------------------------------------- 1 | ctrl_interface=/var/run/wpa_supplicant 2 | ap_scan=1 3 | 4 | network={ 5 | key_mgmt=NONE 6 | } 7 | 8 | 9 | network={ 10 | ssid="hceng_test" 11 | psk="12345678" 12 | } 13 | -------------------------------------------------------------------------------- /tiny4412/10_usb_wifi/rootfs/lib/firmware/rt2870.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hceng/learn/f4af5f9cda8c45c7c29c5876e543a393994af328/tiny4412/10_usb_wifi/rootfs/lib/firmware/rt2870.bin -------------------------------------------------------------------------------- /tiny4412/10_usb_wifi/rootfs/sbin/auto_dhcp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | IFNAME=$1 3 | CMD=$2 4 | if [ "$CMD" = "CONNECTED" ]; then 5 | echo ========connect $IFNAME, dhclient for it======= > /dev/console 6 | dhclient $IFNAME 7 | fi 8 | if [ "$CMD" = "DISCONNECTED" ]; then 9 | echo ========disconnect $IFNAME, kill dhclient for it======= > /dev/console 10 | killall dhclient 11 | fi 12 | -------------------------------------------------------------------------------- /tiny4412/10_usb_wifi/rootfs/sbin/auto_wifi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $ACTION = "add" ]; 3 | then 4 | echo --------usb wifi connect--------- > /dev/console 5 | wpa_supplicant -B -d -i wlan0 -c /etc/wpa_supplicant.conf 6 | wpa_cli -B -i wlan0 -a/sbin/auto_dhcp.sh 7 | else 8 | echo --------usb wifi disconnect--------- > /dev/console 9 | killall wpa_supplicant 10 | killall wpa_cli 11 | killall dhclient 12 | fi 13 | -------------------------------------------------------------------------------- /tiny4412/10_usb_wifi/rootfs/sbin/auto_wifi_ap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $ACTION = "add" ]; 3 | then 4 | echo --------usb wifi connect--------- > /dev/console 5 | hostapd -B /etc/hostapd.conf 6 | ifconfig wlan0 192.168.2.1 7 | dhcpd -cf /etc/dhcpcd.conf wlan0 8 | 9 | else 10 | echo --------usb wifi disconnect--------- > /dev/console 11 | killall hostapd 12 | killall dhcpd 13 | fi 14 | --------------------------------------------------------------------------------