├── .gitignore ├── build └── libs │ ├── arm │ └── readme.txt │ ├── mips │ └── readme.txt │ └── x86 │ ├── common.oyes │ ├── elf.o │ ├── elf.oyes │ └── readme.txt ├── cc.mk ├── coding rule.doc ├── config.mk ├── doc ├── device_manager.rtf ├── graph │ ├── arch.png │ └── arch.sdr ├── ifi_layout.txt ├── network.rtf ├── object.rtf ├── plant │ ├── 8139cp.txt │ ├── PCI 总线驱动.rtf │ └── arm init.rtf ├── section整理.docx └── web │ ├── css │ ├── fa.css │ └── pngfix.js │ ├── dev.htm │ └── index.htm ├── include ├── alloca.h ├── arch │ ├── arm │ │ └── arch │ │ │ ├── byteorder.h │ │ │ ├── errno.h │ │ │ └── fcntl.h │ ├── boot.h │ ├── errno-generic.h │ ├── mips │ │ └── arch │ │ │ ├── byteorder.h │ │ │ ├── errno.h │ │ │ └── fcntl.h │ └── x86 │ │ └── arch │ │ ├── byteorder.h │ │ ├── errno.h │ │ └── fcntl.h ├── c++ │ ├── bits │ │ └── atomicity.h │ ├── c_std │ │ └── bits │ │ │ ├── c++config.h │ │ │ ├── std_climits.h │ │ │ ├── std_cstddef.h │ │ │ └── std_cstdlib.h │ └── std │ │ ├── climits │ │ ├── cstddef │ │ ├── cstdlib │ │ ├── exception │ │ ├── new │ │ └── typeinfo ├── compiler.h ├── ctype.h ├── ddk │ ├── byteorder.h │ ├── compatible.h │ ├── compatible_atomic.h │ ├── compatible_io.h │ ├── compatible_irq.h │ ├── compiler.h │ ├── ddk_for_linux.h │ ├── debug.h │ ├── delay.h │ ├── dma.h │ ├── grid.h │ ├── input.h │ ├── io.h │ ├── irq.h │ ├── little_endian.h │ ├── net.h │ ├── obj.h │ ├── pci │ │ ├── class.h │ │ ├── global_ids.h │ │ ├── pci.h │ │ └── pci_regs.h │ ├── readme.txt │ ├── resource.h │ ├── slab.h │ ├── string.h │ ├── swab.h │ ├── topology.h │ ├── types.h │ └── vfs.h ├── dirent.h ├── dlfcn.h ├── errno.h ├── fcntl.h ├── getopt.h ├── kernel │ ├── ke_atomic.h │ ├── ke_complete.h │ ├── ke_critical.h │ ├── ke_event.h │ ├── ke_lock.h │ ├── ke_memory.h │ ├── ke_mutex.h │ ├── ke_rwlock.h │ ├── ke_srv.h │ ├── ke_thread.h │ ├── kernel.h │ └── readme.txt ├── limits.h ├── list.h ├── pthread.h ├── socket.h ├── stdarg.h ├── stddef.h ├── stdio.h ├── stdlib.h ├── string.h ├── sys │ ├── elf.h │ ├── mman.h │ ├── readme.txt │ ├── socket.h │ └── stat.h ├── types.h ├── unistd.h └── ystd.h ├── license.txt ├── project └── base │ ├── GridOS.sln │ └── GridOS.vcproj ├── readme.md ├── release └── os │ ├── arm │ └── readme.txt │ ├── i386 │ ├── bsp.bin │ └── readme.txt │ ├── mips32 │ └── readme.txt │ ├── mips64 │ └── readme.txt │ └── net │ └── stream │ └── 0 ├── source ├── Makefile ├── drivers │ ├── Makefile │ ├── base │ │ ├── FIRMWARE │ │ │ └── dmi │ │ │ │ └── dmi.h │ │ ├── Makefile │ │ ├── buses │ │ │ ├── Makefile │ │ │ └── pci │ │ │ │ ├── Makefile │ │ │ │ ├── access.c │ │ │ │ ├── arch │ │ │ │ ├── Makefile │ │ │ │ ├── mips │ │ │ │ │ ├── Makefile │ │ │ │ │ └── init.c │ │ │ │ ├── pci-bridge.h │ │ │ │ └── x86 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── asm │ │ │ │ │ └── pci.h │ │ │ │ │ ├── bus_numa.c │ │ │ │ │ ├── bus_numa.h │ │ │ │ │ ├── common.c │ │ │ │ │ ├── direct.c │ │ │ │ │ ├── early.c │ │ │ │ │ ├── i386.c │ │ │ │ │ ├── init.c │ │ │ │ │ ├── irq.c │ │ │ │ │ ├── legacy.c │ │ │ │ │ ├── pci.h │ │ │ │ │ └── pci_x86.h │ │ │ │ ├── bus.c │ │ │ │ ├── configs.h │ │ │ │ ├── host-bridge.c │ │ │ │ ├── main.c │ │ │ │ ├── pci-driver.c │ │ │ │ ├── pci.c │ │ │ │ ├── pci.h │ │ │ │ ├── probe.c │ │ │ │ ├── quirks.c │ │ │ │ ├── search.c │ │ │ │ ├── setup-bus.c │ │ │ │ └── setup-res.c │ │ ├── kb │ │ │ ├── Makefile │ │ │ └── kb.c │ │ └── main.c │ ├── bsp │ │ ├── Makefile │ │ ├── arm │ │ │ ├── Makefile │ │ │ ├── include │ │ │ │ ├── mach-types.h │ │ │ │ └── mach │ │ │ │ │ ├── arch.h │ │ │ │ │ └── map.h │ │ │ └── s3c │ │ │ │ ├── Makefile │ │ │ │ ├── mach-s3c64xx │ │ │ │ ├── Makefile │ │ │ │ ├── common.c │ │ │ │ ├── common.h │ │ │ │ ├── include │ │ │ │ │ └── mach │ │ │ │ │ │ ├── irqs.h │ │ │ │ │ │ ├── map_s3c.h │ │ │ │ │ │ ├── regs-clock.h │ │ │ │ │ │ ├── regs-gpio-memport.h │ │ │ │ │ │ ├── regs-gpio.h │ │ │ │ │ │ ├── regs-irq.h │ │ │ │ │ │ ├── regs-modem.h │ │ │ │ │ │ ├── regs-sys.h │ │ │ │ │ │ ├── regs-syscon-power.h │ │ │ │ │ │ ├── tick.h │ │ │ │ │ │ └── timex.h │ │ │ │ ├── s3cfb.c │ │ │ │ └── smdk6410.c │ │ │ │ └── plat-samsung │ │ │ │ └── include │ │ │ │ └── plat │ │ │ │ ├── map-base.h │ │ │ │ ├── map-s3c.h │ │ │ │ ├── map-s5p.h │ │ │ │ └── samsung_fimd.h │ │ ├── mips │ │ │ ├── Makefile │ │ │ ├── jz │ │ │ │ ├── Makefile │ │ │ │ ├── config.mk │ │ │ │ ├── core │ │ │ │ │ └── include │ │ │ │ │ │ ├── cpu-feature-overrides.h │ │ │ │ │ │ └── soc-ver.h │ │ │ │ └── soc-4775 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── include │ │ │ │ │ ├── irq.h │ │ │ │ │ ├── jz4770.h │ │ │ │ │ └── war.h │ │ │ │ │ ├── irq.c │ │ │ │ │ └── serial.c │ │ │ ├── loongson │ │ │ │ └── include │ │ │ │ │ ├── boot_param.h │ │ │ │ │ ├── cpu-feature-overrides.h │ │ │ │ │ ├── kernel-entry-init.h │ │ │ │ │ ├── loongson.h │ │ │ │ │ ├── mc146818rtc.h │ │ │ │ │ └── war.h │ │ │ ├── plat-generic │ │ │ │ ├── kernel-entry-init.h │ │ │ │ ├── mangle-port.h │ │ │ │ └── spaces.h │ │ │ └── setup.h │ │ └── x86 │ │ │ └── config.mk │ └── hal │ │ ├── Makefile │ │ ├── arch │ │ ├── Makefile │ │ ├── arm │ │ │ ├── Makefile │ │ │ ├── kernel │ │ │ │ ├── Makefile │ │ │ │ ├── abort-ev6.S │ │ │ │ ├── abort-macro.S │ │ │ │ ├── cache-v6.S │ │ │ │ ├── copypage-v6.c │ │ │ │ ├── entry-armv.S │ │ │ │ ├── fault.c │ │ │ │ ├── head-common.S │ │ │ │ ├── head.S │ │ │ │ ├── mmu.c │ │ │ │ ├── pabort-v6.S │ │ │ │ ├── proc-macros.S │ │ │ │ ├── proc-v6.S │ │ │ │ ├── serial.c │ │ │ │ ├── setup.c │ │ │ │ ├── tlb-v6.S │ │ │ │ └── traps.c │ │ │ ├── lds32.txt │ │ │ └── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bitops.h │ │ │ │ ├── clearbit.S │ │ │ │ ├── copy_template.S │ │ │ │ ├── div64.S │ │ │ │ ├── findbit.S │ │ │ │ ├── lib1funcs.S │ │ │ │ ├── memcpy.S │ │ │ │ ├── memset.S │ │ │ │ ├── memzero.S │ │ │ │ ├── strchr.S │ │ │ │ └── strrchr.S │ │ ├── mips │ │ │ ├── Makefile │ │ │ ├── cpu-probe.c │ │ │ ├── dma.c │ │ │ ├── i8259.c │ │ │ ├── irq.c │ │ │ ├── irq_cpu.c │ │ │ ├── lds32.txt │ │ │ ├── lds64.txt │ │ │ ├── lib │ │ │ │ ├── Makefile │ │ │ │ ├── delay.c │ │ │ │ ├── string_32.c │ │ │ │ └── uncached.c │ │ │ ├── main.c │ │ │ ├── mm │ │ │ │ ├── Makefile │ │ │ │ ├── c-loongson.c │ │ │ │ ├── c-r4k.c │ │ │ │ ├── cache.c │ │ │ │ └── tlb-r4k.c │ │ │ ├── plat │ │ │ │ ├── Makefile │ │ │ │ └── loongson │ │ │ │ │ ├── 2f │ │ │ │ │ ├── Makefile │ │ │ │ │ └── irq.c │ │ │ │ │ ├── 3a │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── env.c │ │ │ │ │ ├── htirq.c │ │ │ │ │ ├── htregs.h │ │ │ │ │ ├── irq.c │ │ │ │ │ ├── irqregs.h │ │ │ │ │ ├── smp.c │ │ │ │ │ └── smp.h │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── bonito-irq.c │ │ │ │ │ ├── irq.c │ │ │ │ │ └── setup.c │ │ │ ├── smp.c │ │ │ ├── traps.c │ │ │ └── watch.c │ │ └── x86 │ │ │ ├── Makefile │ │ │ ├── apic │ │ │ ├── Makefile │ │ │ └── apic.c │ │ │ ├── bootloader.c │ │ │ ├── cpu │ │ │ ├── Makefile │ │ │ ├── amd.c │ │ │ ├── cpu.c │ │ │ ├── cpu.h │ │ │ ├── intel.c │ │ │ ├── scattered.c │ │ │ └── topology.c │ │ │ ├── dt.c │ │ │ ├── head_32.S │ │ │ ├── i8253.c │ │ │ ├── i8259.c │ │ │ ├── io_delay.c │ │ │ ├── irq.c │ │ │ ├── irq_32.c │ │ │ ├── irqinit.c │ │ │ ├── lds32.txt │ │ │ ├── lib │ │ │ ├── Makefile │ │ │ ├── delay.c │ │ │ ├── memcpy_32.c │ │ │ ├── rwlock.S │ │ │ └── string_32.c │ │ │ ├── main.c │ │ │ ├── misca_32.S │ │ │ ├── pci-dma.c │ │ │ ├── pci-nommu.c │ │ │ ├── pci_early.c │ │ │ ├── rtc.c │ │ │ ├── serial.c │ │ │ ├── smp.c │ │ │ ├── time.c │ │ │ ├── traps.c │ │ │ ├── tsc.c │ │ │ └── x86_init.c │ │ ├── console │ │ ├── 12x12.c │ │ ├── Makefile │ │ ├── console.c │ │ ├── cursor.c │ │ ├── dotfnt.c │ │ ├── internal.h │ │ ├── pixel.c │ │ └── screen.c │ │ ├── hal_include.mk │ │ ├── include │ │ ├── acpi_pmtmr.h │ │ ├── arch │ │ │ ├── arch.h │ │ │ ├── arm │ │ │ │ └── asm │ │ │ │ │ ├── abicall.h │ │ │ │ │ ├── asm-offsets.h │ │ │ │ │ ├── assembler.h │ │ │ │ │ ├── atomic.h │ │ │ │ │ ├── barrier.h │ │ │ │ │ ├── bitops.h │ │ │ │ │ ├── cache.h │ │ │ │ │ ├── cacheflush.h │ │ │ │ │ ├── cachetype.h │ │ │ │ │ ├── cmpxchg.h │ │ │ │ │ ├── compiler.h │ │ │ │ │ ├── cp15.h │ │ │ │ │ ├── cputype.h │ │ │ │ │ ├── div64.h │ │ │ │ │ ├── dma-mapping.h │ │ │ │ │ ├── domain.h │ │ │ │ │ ├── glue-cache.h │ │ │ │ │ ├── glue-proc.h │ │ │ │ │ ├── glue.h │ │ │ │ │ ├── hwcap.h │ │ │ │ │ ├── io.h │ │ │ │ │ ├── irqflags.h │ │ │ │ │ ├── linkage.h │ │ │ │ │ ├── mc146818rtc.h │ │ │ │ │ ├── mmu.h │ │ │ │ │ ├── opcodes-virt.h │ │ │ │ │ ├── opcodes.h │ │ │ │ │ ├── outercache.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── proc-fns.h │ │ │ │ │ ├── processor.h │ │ │ │ │ ├── procinfo.h │ │ │ │ │ ├── ptrace.h │ │ │ │ │ ├── shmparam.h │ │ │ │ │ ├── spinlock.h │ │ │ │ │ ├── spinlock_types.h │ │ │ │ │ ├── system_info.h │ │ │ │ │ ├── thread.h │ │ │ │ │ ├── timex.h │ │ │ │ │ ├── tlbflush.h │ │ │ │ │ ├── traps.h │ │ │ │ │ ├── unified.h │ │ │ │ │ └── unwind.h │ │ │ ├── asm-generic │ │ │ │ ├── atomic-long.h │ │ │ │ ├── bitops │ │ │ │ │ ├── atomic-long.h │ │ │ │ │ ├── ffz.h │ │ │ │ │ ├── fls64.h │ │ │ │ │ └── non-atomic.h │ │ │ │ ├── cmpxchg-local.h │ │ │ │ ├── delay.h │ │ │ │ ├── div64.h │ │ │ │ ├── param.h │ │ │ │ └── sections.h │ │ │ ├── mips │ │ │ │ └── asm │ │ │ │ │ ├── abicall.h │ │ │ │ │ ├── addrspace.h │ │ │ │ │ ├── asm-offsets.h │ │ │ │ │ ├── asm.h │ │ │ │ │ ├── asmmacro-32.h │ │ │ │ │ ├── asmmacro-64.h │ │ │ │ │ ├── asmmacro.h │ │ │ │ │ ├── atomic.h │ │ │ │ │ ├── barrier.h │ │ │ │ │ ├── bcache.h │ │ │ │ │ ├── bitops.h │ │ │ │ │ ├── break.h │ │ │ │ │ ├── bug.h │ │ │ │ │ ├── cache.h │ │ │ │ │ ├── cacheflush.h │ │ │ │ │ ├── cacheops.h │ │ │ │ │ ├── cmpxchg.h │ │ │ │ │ ├── cpu-features.h │ │ │ │ │ ├── cpu-info.h │ │ │ │ │ ├── cpu.h │ │ │ │ │ ├── delay.h │ │ │ │ │ ├── div64.h │ │ │ │ │ ├── dma-mapping.h │ │ │ │ │ ├── fpregdef.h │ │ │ │ │ ├── fpu.h │ │ │ │ │ ├── hardirq.h │ │ │ │ │ ├── hazards.h │ │ │ │ │ ├── hw_irq.h │ │ │ │ │ ├── i8259.h │ │ │ │ │ ├── io.h │ │ │ │ │ ├── irq.h │ │ │ │ │ ├── irq_cpu.h │ │ │ │ │ ├── irqflags.h │ │ │ │ │ ├── linkage.h │ │ │ │ │ ├── mc146818rtc.h │ │ │ │ │ ├── mipsmtregs.h │ │ │ │ │ ├── mipsregs.h │ │ │ │ │ ├── param.h │ │ │ │ │ ├── pgtable-bits.h │ │ │ │ │ ├── processor.h │ │ │ │ │ ├── ptrace.h │ │ │ │ │ ├── r4kcache.h │ │ │ │ │ ├── regdef.h │ │ │ │ │ ├── sections.h │ │ │ │ │ ├── sgidefs.h │ │ │ │ │ ├── smp.h │ │ │ │ │ ├── spinlock.h │ │ │ │ │ ├── spinlock_types.h │ │ │ │ │ ├── spram.h │ │ │ │ │ ├── stackframe.h │ │ │ │ │ ├── stacktrace.h │ │ │ │ │ ├── system.h │ │ │ │ │ ├── thread.h │ │ │ │ │ ├── timex.h │ │ │ │ │ ├── war.h │ │ │ │ │ ├── watch.h │ │ │ │ │ └── wbflush.h │ │ │ └── x86 │ │ │ │ └── asm │ │ │ │ ├── abicall.h │ │ │ │ ├── alternative-asm.h │ │ │ │ ├── alternative.h │ │ │ │ ├── apic.h │ │ │ │ ├── apicdef.h │ │ │ │ ├── asm.h │ │ │ │ ├── atomic.h │ │ │ │ ├── barrier.h │ │ │ │ ├── bitops.h │ │ │ │ ├── cache.h │ │ │ │ ├── cmpxchg.h │ │ │ │ ├── cmpxchg_32.h │ │ │ │ ├── cpu.h │ │ │ │ ├── cpufeature.h │ │ │ │ ├── cpufeature_def.h │ │ │ │ ├── debugreg.h │ │ │ │ ├── delay.h │ │ │ │ ├── desc.h │ │ │ │ ├── desc_defs.h │ │ │ │ ├── div64.h │ │ │ │ ├── dma-mapping.h │ │ │ │ ├── dwarf2.h │ │ │ │ ├── fixmap.h │ │ │ │ ├── frame.h │ │ │ │ ├── hpet.h │ │ │ │ ├── hw_irq.h │ │ │ │ ├── hypervisor.h │ │ │ │ ├── i387.h │ │ │ │ ├── i8259.h │ │ │ │ ├── io.h │ │ │ │ ├── iommu.h │ │ │ │ ├── irq.h │ │ │ │ ├── irq_vectors.h │ │ │ │ ├── irqflags.h │ │ │ │ ├── ldt.h │ │ │ │ ├── linkage.h │ │ │ │ ├── mc146818rtc.h │ │ │ │ ├── mce.h │ │ │ │ ├── mpspec.h │ │ │ │ ├── msr-index.h │ │ │ │ ├── msr.h │ │ │ │ ├── param.h │ │ │ │ ├── pci-direct.h │ │ │ │ ├── pci_x86.h │ │ │ │ ├── processor-flags.h │ │ │ │ ├── processor.h │ │ │ │ ├── processor_probe.h │ │ │ │ ├── ptrace.h │ │ │ │ ├── required-features.h │ │ │ │ ├── rwlock.h │ │ │ │ ├── segment.h │ │ │ │ ├── serial.h │ │ │ │ ├── smp.h │ │ │ │ ├── spinlock.h │ │ │ │ ├── spinlock_types.h │ │ │ │ ├── system.h │ │ │ │ ├── thread.h │ │ │ │ ├── timer.h │ │ │ │ ├── timex.h │ │ │ │ ├── tlbflush.h │ │ │ │ ├── traps.h │ │ │ │ ├── tsc.h │ │ │ │ └── x86_init.h │ │ ├── atomic.h │ │ ├── bcd.h │ │ ├── bitops.h │ │ ├── cache.h │ │ ├── clockchips.h │ │ ├── clocksource.h │ │ ├── compiler.h │ │ ├── console.h │ │ ├── const.h │ │ ├── cpumask.h │ │ ├── debug.h │ │ ├── delay.h │ │ ├── dma-mapping.h │ │ ├── hal_config.h │ │ ├── hardirq.h │ │ ├── i8253.h │ │ ├── irq.h │ │ ├── irqdesc.h │ │ ├── irqflags.h │ │ ├── linkage.h │ │ ├── math64.h │ │ ├── mc146818rtc.h │ │ ├── misc.h │ │ ├── param.h │ │ ├── percpu-defs.h │ │ ├── percpu.h │ │ ├── preempt.h │ │ ├── readme.txt │ │ ├── rtc.h │ │ ├── screen.h │ │ ├── smp.h │ │ ├── spinlock.h │ │ ├── string.h │ │ ├── stringify.h │ │ ├── tick.h │ │ ├── time.h │ │ ├── timer.h │ │ ├── topology.h │ │ └── types.h │ │ ├── irq │ │ ├── Makefile │ │ ├── chip.c │ │ ├── dpc.c │ │ ├── dummychip.c │ │ ├── hal.c │ │ ├── handle.c │ │ ├── internals.h │ │ ├── irqdesc.c │ │ ├── manage.c │ │ ├── resend.c │ │ ├── settings.h │ │ └── spurious.c │ │ ├── libs │ │ ├── Makefile │ │ ├── div64.c │ │ └── printk.c │ │ ├── main │ │ ├── Makefile │ │ ├── bootmod.c │ │ ├── devres.c │ │ ├── dma.c │ │ ├── interface.c │ │ ├── main.c │ │ ├── malloc.c │ │ ├── obj.c │ │ └── resource.c │ │ ├── problem list.txt │ │ └── time │ │ ├── Makefile │ │ ├── clockevents.c │ │ ├── clocksource.c │ │ ├── i8253.c │ │ ├── rtc.c │ │ ├── tick-common.c │ │ ├── time.c │ │ └── timer.c ├── initloader │ ├── Makefile │ ├── ReadMe │ ├── elf.c │ ├── elf.h │ ├── grub.h │ ├── ldr.lds │ ├── loader.c │ ├── start.S │ ├── utils.c │ └── utils.h ├── kernel │ ├── Makefile │ ├── arch │ │ ├── Makefile │ │ ├── arm │ │ │ ├── Makefile │ │ │ ├── page.c │ │ │ └── thread.c │ │ ├── mips │ │ │ ├── Makefile │ │ │ ├── fault.c │ │ │ ├── page.c │ │ │ ├── setup.c │ │ │ ├── thread.c │ │ │ └── traps.c │ │ └── x86 │ │ │ ├── Makefile │ │ │ ├── page.c │ │ │ ├── thread.c │ │ │ └── tss.c │ ├── atomic.c │ ├── complete.c │ ├── cpu.c │ ├── cs.c │ ├── ddk_for_drv.c │ ├── event.c │ ├── handle.c │ ├── include │ │ ├── arch │ │ │ ├── arm │ │ │ │ └── arch │ │ │ │ │ ├── page.h │ │ │ │ │ ├── pgtable-2level-hwdef.h │ │ │ │ │ ├── pgtable-2level-types.h │ │ │ │ │ ├── pgtable-2level.h │ │ │ │ │ ├── pgtable-hwdef.h │ │ │ │ │ ├── thread.h │ │ │ │ │ └── walk-2level.h │ │ │ ├── mips │ │ │ │ └── arch │ │ │ │ │ ├── page.h │ │ │ │ │ ├── thread.h │ │ │ │ │ └── walk.h │ │ │ └── x86 │ │ │ │ └── arch │ │ │ │ ├── page.h │ │ │ │ └── thread.h │ │ ├── cpu.h │ │ ├── exe.h │ │ ├── handle.h │ │ ├── memory.h │ │ ├── msg.h │ │ ├── page.h │ │ ├── priority.h │ │ ├── process.h │ │ ├── section.h │ │ ├── sync.h │ │ ├── thread.h │ │ ├── vm.h │ │ └── walk.h │ ├── kernel.mk │ ├── lock.c │ ├── memory │ │ ├── Makefile │ │ ├── ctx.c │ │ ├── debug.c │ │ ├── exp.c │ │ ├── pa.c │ │ ├── page.c │ │ ├── percpu.c │ │ ├── section.c │ │ ├── valloc.c │ │ ├── vm.c │ │ └── walk.c │ ├── mutex.c │ ├── object.c │ ├── process │ │ ├── Makefile │ │ ├── debug.c │ │ ├── exe.c │ │ ├── msg.c │ │ ├── process.c │ │ ├── sched.c │ │ ├── sleep.c │ │ ├── sync.c │ │ └── thread.c │ └── srv.c ├── libs │ ├── Makefile │ ├── c++ │ │ ├── Makefile │ │ ├── cxxabi │ │ │ ├── Makefile │ │ │ ├── config │ │ │ │ ├── atomic_word.h │ │ │ │ ├── atomicity.h │ │ │ │ ├── cxxabi_tweaks.h │ │ │ │ └── i386.h │ │ │ ├── coretypes.h │ │ │ ├── dwarf2.h │ │ │ ├── gthr-single.h │ │ │ ├── gthr.h │ │ │ ├── tsystem.h │ │ │ ├── unwind-dw2-fde-darwin.c │ │ │ ├── unwind-dw2-fde.c │ │ │ ├── unwind-dw2-fde.h │ │ │ ├── unwind-dw2.c │ │ │ ├── unwind-dw2.h │ │ │ ├── unwind-pe.h │ │ │ ├── unwind.h │ │ │ └── unwind.inc │ │ └── libsupc++ │ │ │ ├── Makefile │ │ │ ├── cxxabi.h │ │ │ ├── del_op.cc │ │ │ ├── del_opnt.cc │ │ │ ├── del_opv.cc │ │ │ ├── del_opvnt.cc │ │ │ ├── eh_alloc.cc │ │ │ ├── eh_aux_runtime.cc │ │ │ ├── eh_catch.cc │ │ │ ├── eh_exception.cc │ │ │ ├── eh_globals.cc │ │ │ ├── eh_personality.cc │ │ │ ├── eh_term_handler.cc │ │ │ ├── eh_terminate.cc │ │ │ ├── eh_throw.cc │ │ │ ├── eh_type.cc │ │ │ ├── eh_unex_handler.cc │ │ │ ├── exception_defines.h │ │ │ ├── guard.cc │ │ │ ├── new_handler.cc │ │ │ ├── new_op.cc │ │ │ ├── new_opnt.cc │ │ │ ├── new_opv.cc │ │ │ ├── new_opvnt.cc │ │ │ ├── pure.cc │ │ │ ├── tinfo.cc │ │ │ ├── tinfo.h │ │ │ ├── tinfo2.cc │ │ │ ├── unwind-cxx.h │ │ │ ├── vec.cc │ │ │ └── vterminate.cc │ ├── common │ │ ├── Makefile │ │ ├── blkbuf.c │ │ ├── cpu │ │ │ ├── Makefile │ │ │ ├── atomic.c │ │ │ ├── bit.c │ │ │ ├── bitmap.c │ │ │ ├── string.c │ │ │ └── ucmpdi2.c │ │ ├── i2p.c │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── arm │ │ │ │ │ └── cl_string.h │ │ │ │ ├── mips │ │ │ │ │ └── cl_string.h │ │ │ │ └── x86 │ │ │ │ │ ├── cl_string.h │ │ │ │ │ └── string_32.h │ │ │ ├── bitmap.h │ │ │ ├── bits.h │ │ │ ├── blkbuf.h │ │ │ ├── cl_atomic.h │ │ │ ├── cl_fname.h │ │ │ ├── digits.h │ │ │ ├── exefmt.h │ │ │ ├── i2p.h │ │ │ ├── memalloc.h │ │ │ ├── message.h │ │ │ ├── object.h │ │ │ └── ring_buff.h │ │ ├── malloc.c │ │ ├── misc │ │ │ ├── Makefile │ │ │ ├── fname.c │ │ │ ├── h2d.c │ │ │ └── vsprintf.c │ │ ├── msg.c │ │ ├── object │ │ │ ├── Makefile │ │ │ ├── name.c │ │ │ ├── object.c │ │ │ └── type.c │ │ └── ring_buff.c │ ├── elf2 │ │ └── elf.h │ ├── grid │ │ ├── Makefile │ │ ├── arch │ │ │ ├── Makefile │ │ │ ├── arm │ │ │ │ ├── 32 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── def.h │ │ │ │ │ ├── pthread_spin_init.c │ │ │ │ │ ├── pthread_spin_lock.S │ │ │ │ │ └── pthread_spin_unlock.S │ │ │ │ └── Makefile │ │ │ ├── mips │ │ │ │ ├── 32 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── def.h │ │ │ │ │ └── pthread_spin_init.c │ │ │ │ └── Makefile │ │ │ └── x86 │ │ │ │ ├── 32 │ │ │ │ ├── Makefile │ │ │ │ ├── def.h │ │ │ │ ├── pthread_spin_init.c │ │ │ │ ├── pthread_spin_lock.S │ │ │ │ └── pthread_spin_unlock.S │ │ │ │ └── Makefile │ │ ├── crt0 │ │ │ ├── Makefile │ │ │ ├── exe.mk │ │ │ ├── head_exe.c │ │ │ ├── head_so.c │ │ │ └── so.mk │ │ ├── dirent │ │ │ ├── Makefile │ │ │ ├── closedir.c │ │ │ ├── opendir.c │ │ │ └── readdir.c │ │ ├── dlfun │ │ │ ├── Makefile │ │ │ ├── dl_crt.c │ │ │ ├── dladdr.c │ │ │ ├── dlclose.c │ │ │ ├── dlerr.c │ │ │ ├── dlfcn.h │ │ │ ├── dlopen.c │ │ │ ├── dlsym.c │ │ │ └── lazy.S │ │ ├── fd.c │ │ ├── include │ │ │ ├── crt.h │ │ │ ├── dir.h │ │ │ ├── env.h │ │ │ ├── file.h │ │ │ ├── getopt_int.h │ │ │ ├── nocache_file.h │ │ │ ├── posix.h │ │ │ ├── socket_file.h │ │ │ ├── std_console.h │ │ │ ├── stream_file.h │ │ │ └── sys │ │ │ │ ├── file_req.h │ │ │ │ ├── ke_req.h │ │ │ │ ├── net_req.h │ │ │ │ ├── session_req.h │ │ │ │ ├── syscall.h │ │ │ │ └── sysdep.h │ │ ├── main.c │ │ ├── malloc │ │ │ ├── Makefile │ │ │ ├── malloc.c │ │ │ ├── malloc.h │ │ │ └── mmap.c │ │ ├── socket │ │ │ ├── Makefile │ │ │ ├── af_inet.c │ │ │ ├── af_unix.c │ │ │ └── socket.c │ │ ├── stdio │ │ │ ├── Makefile │ │ │ ├── fclose.c │ │ │ ├── fopen.c │ │ │ ├── fread.c │ │ │ ├── ftruncate.c │ │ │ ├── fwrite.c │ │ │ ├── getch.c │ │ │ ├── nocache_file.c │ │ │ ├── printf.c │ │ │ └── stream_file.c │ │ ├── stdlib │ │ │ ├── Makefile │ │ │ ├── abort.c │ │ │ ├── chdir.c │ │ │ ├── exit.c │ │ │ ├── getenv.c │ │ │ ├── getopt.c │ │ │ └── setenv.c │ │ ├── string │ │ │ ├── Makefile │ │ │ ├── memcmp.c │ │ │ ├── memcpy.c │ │ │ ├── strcat.c │ │ │ ├── strchr.c │ │ │ ├── strcmp.c │ │ │ ├── strcpy.c │ │ │ ├── strlen.c │ │ │ ├── strncmp.c │ │ │ ├── strncpy.c │ │ │ ├── strnlen.c │ │ │ └── strrchr.c │ │ └── sys │ │ │ ├── Makefile │ │ │ ├── fb.c │ │ │ ├── file.c │ │ │ ├── process.c │ │ │ ├── stdio.c │ │ │ └── vmalloc.c │ ├── mk.shared │ └── pthread │ │ ├── Makefile │ │ ├── create.c │ │ ├── ihash.c │ │ ├── ihash.h │ │ ├── implement.h │ │ ├── pthread.c │ │ ├── pthread_key.c │ │ ├── pthread_once.c │ │ ├── pthread_specific.c │ │ ├── pthread_spin_destroy.c │ │ ├── readme.txt │ │ └── spin.c ├── programs │ ├── Makefile │ ├── baxi │ │ ├── Makefile │ │ ├── cmd │ │ │ ├── Makefile │ │ │ ├── _null.c │ │ │ ├── cat.c │ │ │ ├── cd.c │ │ │ ├── cmd.c │ │ │ ├── cmd.h │ │ │ ├── cp.c │ │ │ ├── help.c │ │ │ ├── ls.c │ │ │ ├── rm.c │ │ │ └── test_ringbuff.c │ │ └── main.c │ ├── dl │ │ ├── Makefile │ │ ├── libs.c │ │ └── main.c │ ├── plant │ │ ├── Emulators │ │ │ ├── InfoNES │ │ │ │ ├── 90.nes │ │ │ │ ├── InfoNES093J_Src.zip │ │ │ │ ├── InfoNES093J_Src │ │ │ │ │ ├── InfoNES.cpp │ │ │ │ │ ├── InfoNES.h │ │ │ │ │ ├── InfoNES_Mapper.cpp │ │ │ │ │ ├── InfoNES_Mapper.h │ │ │ │ │ ├── InfoNES_System.h │ │ │ │ │ ├── InfoNES_Types.h │ │ │ │ │ ├── InfoNES_pAPU.cpp │ │ │ │ │ ├── InfoNES_pAPU.h │ │ │ │ │ ├── K6502.cpp │ │ │ │ │ ├── K6502.h │ │ │ │ │ ├── K6502_rw.h │ │ │ │ │ ├── Makefile │ │ │ │ │ └── mapper │ │ │ │ │ │ ├── InfoNES_Mapper_000.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_001.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_002.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_003.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_004.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_005.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_006.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_007.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_008.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_009.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_010.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_011.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_013.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_015.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_016.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_017.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_018.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_019.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_021.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_022.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_023.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_024.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_025.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_026.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_032.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_033.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_034.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_040.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_041.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_042.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_043.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_044.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_045.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_046.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_047.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_048.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_049.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_050.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_051.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_057.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_058.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_060.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_061.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_062.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_064.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_065.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_066.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_067.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_068.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_069.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_070.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_071.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_072.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_073.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_074.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_075.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_076.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_077.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_078.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_079.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_080.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_082.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_083.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_085.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_086.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_087.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_088.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_089.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_090.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_091.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_092.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_093.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_094.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_095.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_096.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_097.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_100.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_101.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_105.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_107.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_108.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_109.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_110.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_112.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_113.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_114.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_115.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_116.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_117.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_118.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_119.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_122.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_133.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_134.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_135.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_140.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_151.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_160.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_180.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_181.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_182.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_183.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_185.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_187.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_188.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_189.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_191.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_193.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_194.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_200.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_201.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_202.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_222.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_225.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_226.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_227.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_228.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_229.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_230.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_231.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_232.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_233.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_234.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_235.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_236.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_240.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_241.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_242.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_243.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_244.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_245.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_246.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_248.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_249.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_251.cpp │ │ │ │ │ │ ├── InfoNES_Mapper_252.cpp │ │ │ │ │ │ └── InfoNES_Mapper_255.cpp │ │ │ │ ├── Makefile │ │ │ │ └── main.cpp │ │ │ └── Makefile │ │ └── Makefile │ ├── startup │ │ ├── Makefile │ │ └── main.c │ └── test │ │ ├── Makefile │ │ ├── c++ │ │ ├── Makefile │ │ └── test_new.cc │ │ ├── fnotify │ │ ├── Makefile │ │ └── main.c │ │ ├── multipi │ │ ├── Makefile │ │ └── main.c │ │ ├── pthread │ │ ├── Makefile │ │ └── main.c │ │ └── tcpip │ │ ├── Makefile │ │ └── main.c ├── subsystem │ ├── Makefile │ ├── fs │ │ ├── Makefile │ │ ├── block.c │ │ ├── fsnotify.c │ │ ├── include │ │ │ ├── cache.h │ │ │ ├── fsnotify.h │ │ │ ├── fss.h │ │ │ ├── node.h │ │ │ └── vfs.h │ │ ├── main.c │ │ ├── map.c │ │ ├── mltt.c │ │ └── tree.c │ ├── network │ │ ├── Makefile │ │ ├── main.c │ │ └── protocol │ │ │ ├── Makefile │ │ │ └── ip │ │ │ ├── Makefile │ │ │ ├── non_user │ │ │ ├── Makefile │ │ │ └── main.c │ │ │ └── user │ │ │ ├── Makefile │ │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── arch.h │ │ │ │ ├── bpstruct.h │ │ │ │ ├── cc.h │ │ │ │ ├── epstruct.h │ │ │ │ ├── hash.h │ │ │ │ ├── hlist_nulls.h │ │ │ │ ├── lwipopts.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ │ ├── ipv4 │ │ │ │ └── lwip │ │ │ │ │ ├── autoip.h │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── igmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── inet_chksum.h │ │ │ │ │ ├── ip.h │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ └── ip_frag.h │ │ │ ├── lwip │ │ │ │ ├── api.h │ │ │ │ ├── api_msg.h │ │ │ │ ├── arch.h │ │ │ │ ├── debug.h │ │ │ │ ├── def.h │ │ │ │ ├── dhcp.h │ │ │ │ ├── dns.h │ │ │ │ ├── err.h │ │ │ │ ├── init.h │ │ │ │ ├── mem.h │ │ │ │ ├── memp.h │ │ │ │ ├── memp_std.h │ │ │ │ ├── netbuf.h │ │ │ │ ├── netdb.h │ │ │ │ ├── netif.h │ │ │ │ ├── netifapi.h │ │ │ │ ├── opt.h │ │ │ │ ├── pbuf.h │ │ │ │ ├── raw.h │ │ │ │ ├── sio.h │ │ │ │ ├── snmp.h │ │ │ │ ├── snmp_asn1.h │ │ │ │ ├── snmp_msg.h │ │ │ │ ├── snmp_structs.h │ │ │ │ ├── sockets.h │ │ │ │ ├── stats.h │ │ │ │ ├── sys.h │ │ │ │ ├── tcp.h │ │ │ │ ├── tcp_impl.h │ │ │ │ ├── tcpip.h │ │ │ │ ├── timers.h │ │ │ │ └── udp.h │ │ │ └── netif │ │ │ │ ├── etharp.h │ │ │ │ ├── ppp_oe.h │ │ │ │ └── slipif.h │ │ │ ├── main.c │ │ │ ├── src │ │ │ ├── Makefile │ │ │ ├── def.c │ │ │ ├── etharp.c │ │ │ ├── hash.c │ │ │ ├── init.c │ │ │ ├── ipv4 │ │ │ │ ├── Makefile │ │ │ │ ├── icmp.c │ │ │ │ ├── inet_chksum.c │ │ │ │ ├── ip.c │ │ │ │ ├── ip_addr.c │ │ │ │ └── ip_frag.c │ │ │ ├── memp.c │ │ │ ├── netif.c │ │ │ ├── pbuf.c │ │ │ ├── stats.c │ │ │ ├── tcp.c │ │ │ ├── tcp_in.c │ │ │ ├── tcp_out.c │ │ │ ├── timers.c │ │ │ └── udp.c │ │ │ └── utils.c │ └── session │ │ ├── Makefile │ │ ├── ifi.c │ │ ├── kb_unicode.c │ │ ├── kb_unicode.h │ │ ├── main.c │ │ ├── session.h │ │ └── stdio.c └── vc │ └── readme.txt ├── test └── mac.sh └── tools └── kpck └── Makefile /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE! Don't add files that are generated in specific 3 | # subdirectories here. Add them in the ".gitignore" file 4 | # in that subdirectory instead. 5 | # 6 | # NOTE! Please use 'git ls-files -i --exclude-standard' 7 | # command after changing this file, to see if there are 8 | # any tracked files which get ignored after the change. 9 | # 10 | # Normal rules 11 | # 12 | .* 13 | *.o 14 | *.sys 15 | *.org 16 | *.o.* 17 | *.a 18 | *.s 19 | *.ko 20 | *.so 21 | *.so.dbg 22 | *.mod.c 23 | *.i 24 | *.lst 25 | *.symtypes 26 | *.order 27 | modules.builtin 28 | *.elf 29 | *.bin 30 | *.gz 31 | *.bz2 32 | *.lzma 33 | *.xz 34 | *.lzo 35 | *.patch 36 | *.gcno 37 | test 38 | 39 | # 40 | # git files that we don't want to ignore even it they are dot-files 41 | # 42 | !.gitignore 43 | !.mailmap 44 | !.S 45 | -------------------------------------------------------------------------------- /build/libs/arm/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/build/libs/arm/readme.txt -------------------------------------------------------------------------------- /build/libs/mips/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/build/libs/mips/readme.txt -------------------------------------------------------------------------------- /build/libs/x86/common.oyes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/build/libs/x86/common.oyes -------------------------------------------------------------------------------- /build/libs/x86/elf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/build/libs/x86/elf.o -------------------------------------------------------------------------------- /build/libs/x86/elf.oyes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/build/libs/x86/elf.oyes -------------------------------------------------------------------------------- /build/libs/x86/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/build/libs/x86/readme.txt -------------------------------------------------------------------------------- /cc.mk: -------------------------------------------------------------------------------- 1 | .c.o: 2 | $(CC) $(my_cflags) $(ADD_INCLUDE) $(COMMON_CC_FLAGS) $(LAST_INCLUDE) -o $@ $< 3 | .cpp.o: 4 | $(CC) $(my_cflags) $(ADD_INCLUDE) $(COMMON_CC_FLAGS) $(LAST_INCLUDE) -o $@ $< 5 | .S.o: 6 | $(CC) $(my_cflags) $(ADD_INCLUDE) -D__ASSEMBLY__ $(COMMON_CC_FLAGS) $(LAST_INCLUDE) -o $@ $< 7 | .cc.o: 8 | $(C++) $(my_c++flags) $(ADD_INCLUDE) $(LAST_INCLUDE) -o $@ $< 9 | clean: 10 | @rm -f *.o *.a *.so *.oyes 11 | @for i in $(PARTS); do $(MAKE) -C $$i clean; done 12 | 13 | subs_parts: 14 | @for i in $(PARTS); do $(MAKE) -C $$i; done 15 | 16 | to_image: 17 | c:\\image\\winimage.exe d:\\q64\\hd0.img -I $(MY_BUILD_BASE)\\release 18 | 19 | -------------------------------------------------------------------------------- /coding rule.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/coding rule.doc -------------------------------------------------------------------------------- /config.mk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/config.mk -------------------------------------------------------------------------------- /doc/graph/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/doc/graph/arch.png -------------------------------------------------------------------------------- /doc/graph/arch.sdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/doc/graph/arch.sdr -------------------------------------------------------------------------------- /doc/ifi_layout.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/doc/ifi_layout.txt -------------------------------------------------------------------------------- /doc/plant/8139cp.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/doc/plant/8139cp.txt -------------------------------------------------------------------------------- /doc/section整理.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/doc/section整理.docx -------------------------------------------------------------------------------- /include/alloca.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/alloca.h -------------------------------------------------------------------------------- /include/arch/arm/arch/byteorder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/arch/arm/arch/byteorder.h -------------------------------------------------------------------------------- /include/arch/arm/arch/errno.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/arch/arm/arch/errno.h -------------------------------------------------------------------------------- /include/arch/arm/arch/fcntl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/arch/arm/arch/fcntl.h -------------------------------------------------------------------------------- /include/arch/boot.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/arch/boot.h -------------------------------------------------------------------------------- /include/arch/mips/arch/byteorder.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_BYTEORDER_H 2 | #define _ASM_BYTEORDER_H 3 | 4 | #if defined(__MIPSEB__) 5 | #include 6 | #elif defined(__MIPSEL__) 7 | #include 8 | #else 9 | # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" 10 | #endif 11 | 12 | #endif /* _ASM_BYTEORDER_H */ 13 | -------------------------------------------------------------------------------- /include/arch/mips/arch/errno.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/arch/mips/arch/errno.h -------------------------------------------------------------------------------- /include/arch/x86/arch/byteorder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/arch/x86/arch/byteorder.h -------------------------------------------------------------------------------- /include/arch/x86/arch/errno.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/arch/x86/arch/errno.h -------------------------------------------------------------------------------- /include/c++/c_std/bits/c++config.h: -------------------------------------------------------------------------------- 1 | //for last use 2 | #define _GLIBCXX_WEAK_DEFINITION __attribute__ ((weak)) 3 | 4 | 5 | -------------------------------------------------------------------------------- /include/compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/compiler.h -------------------------------------------------------------------------------- /include/ctype.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ctype.h -------------------------------------------------------------------------------- /include/ddk/byteorder.h: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /include/ddk/compatible.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/compatible.h -------------------------------------------------------------------------------- /include/ddk/compatible_atomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | OLD driver need this 3 | */ 4 | #ifndef DDK_COMPATIBLE_INTERFACE_ATOMIC 5 | #define DDK_COMPATIBLE_INTERFACE_ATOMIC 6 | 7 | #include 8 | 9 | #define atomic_dec ke_atomic_dec 10 | #define atomic_add_return(c, a) ke_atomic_add_return(a, c) 11 | #define atomic_inc_return(v) ke_atomic_add_return(1, (v)) 12 | #define atomic_sub_return(c, a) ke_atomic_sub_return(a, c) 13 | 14 | typedef struct ke_atomic atomic_t; 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /include/ddk/compatible_irq.h: -------------------------------------------------------------------------------- 1 | /* 2 | OLD driver need this 3 | */ 4 | #ifndef DDK_COMPATIBLE_INTERFACE_IRQ 5 | #define DDK_COMPATIBLE_INTERFACE_IRQ 6 | 7 | #include 8 | 9 | /* IRQ */ 10 | #define local_irq_save hal_local_irq_save 11 | #define local_irq_restore hal_local_irq_restore 12 | 13 | #define request_irq hal_irq_request 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /include/ddk/compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/compiler.h -------------------------------------------------------------------------------- /include/ddk/ddk_for_linux.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/ddk_for_linux.h -------------------------------------------------------------------------------- /include/ddk/debug.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/debug.h -------------------------------------------------------------------------------- /include/ddk/delay.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/delay.h -------------------------------------------------------------------------------- /include/ddk/dma.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/dma.h -------------------------------------------------------------------------------- /include/ddk/grid.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/grid.h -------------------------------------------------------------------------------- /include/ddk/input.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/input.h -------------------------------------------------------------------------------- /include/ddk/io.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/io.h -------------------------------------------------------------------------------- /include/ddk/irq.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/irq.h -------------------------------------------------------------------------------- /include/ddk/net.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/net.h -------------------------------------------------------------------------------- /include/ddk/obj.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/obj.h -------------------------------------------------------------------------------- /include/ddk/pci/class.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/pci/class.h -------------------------------------------------------------------------------- /include/ddk/pci/pci.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/pci/pci.h -------------------------------------------------------------------------------- /include/ddk/pci/pci_regs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/pci/pci_regs.h -------------------------------------------------------------------------------- /include/ddk/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/readme.txt -------------------------------------------------------------------------------- /include/ddk/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/resource.h -------------------------------------------------------------------------------- /include/ddk/slab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/slab.h -------------------------------------------------------------------------------- /include/ddk/string.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/string.h -------------------------------------------------------------------------------- /include/ddk/topology.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/topology.h -------------------------------------------------------------------------------- /include/ddk/types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/types.h -------------------------------------------------------------------------------- /include/ddk/vfs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ddk/vfs.h -------------------------------------------------------------------------------- /include/dirent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/dirent.h -------------------------------------------------------------------------------- /include/dlfcn.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/dlfcn.h -------------------------------------------------------------------------------- /include/errno.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/errno.h -------------------------------------------------------------------------------- /include/fcntl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/fcntl.h -------------------------------------------------------------------------------- /include/kernel/ke_atomic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_atomic.h -------------------------------------------------------------------------------- /include/kernel/ke_complete.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_complete.h -------------------------------------------------------------------------------- /include/kernel/ke_critical.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_critical.h -------------------------------------------------------------------------------- /include/kernel/ke_event.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_event.h -------------------------------------------------------------------------------- /include/kernel/ke_lock.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_lock.h -------------------------------------------------------------------------------- /include/kernel/ke_memory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_memory.h -------------------------------------------------------------------------------- /include/kernel/ke_mutex.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_mutex.h -------------------------------------------------------------------------------- /include/kernel/ke_rwlock.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_rwlock.h -------------------------------------------------------------------------------- /include/kernel/ke_srv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_srv.h -------------------------------------------------------------------------------- /include/kernel/ke_thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/ke_thread.h -------------------------------------------------------------------------------- /include/kernel/kernel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/kernel.h -------------------------------------------------------------------------------- /include/kernel/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/kernel/readme.txt -------------------------------------------------------------------------------- /include/limits.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/limits.h -------------------------------------------------------------------------------- /include/list.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/list.h -------------------------------------------------------------------------------- /include/pthread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/pthread.h -------------------------------------------------------------------------------- /include/socket.h: -------------------------------------------------------------------------------- 1 | #ifndef SOCKET_H 2 | #define SOCKET_H 3 | 4 | #include 5 | 6 | int socket(int domain, int type, int protocol); 7 | int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/stdarg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/stdarg.h -------------------------------------------------------------------------------- /include/stddef.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/stddef.h -------------------------------------------------------------------------------- /include/stdio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/stdio.h -------------------------------------------------------------------------------- /include/stdlib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/stdlib.h -------------------------------------------------------------------------------- /include/string.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/string.h -------------------------------------------------------------------------------- /include/sys/elf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/sys/elf.h -------------------------------------------------------------------------------- /include/sys/mman.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/sys/mman.h -------------------------------------------------------------------------------- /include/sys/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/sys/readme.txt -------------------------------------------------------------------------------- /include/sys/socket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/sys/socket.h -------------------------------------------------------------------------------- /include/sys/stat.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/sys/stat.h -------------------------------------------------------------------------------- /include/types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/types.h -------------------------------------------------------------------------------- /include/unistd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/unistd.h -------------------------------------------------------------------------------- /include/ystd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/include/ystd.h -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/license.txt -------------------------------------------------------------------------------- /project/base/GridOS.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/project/base/GridOS.vcproj -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # GridOS 2 | 3 | 时隔10年,我们还是希望这个项目继续,有时间就多写点,没时间就少写点。 4 | 5 | GridOS 是一行行写的系统,包括内核、用户态库、简单应用。另外我们也会移植许多代码。你如果问GridOS 要做成什么样子? 6 | 我们也不知道,我们只是想传递一些思想、探索一些问题、学习操作系统底层技术,你也可以参与! 7 | 8 | 9 | ## 最新RoadMap 10 | 11 | 2022-6月 12 | - 装载ELF 可执行文件 13 | - 毕竟10年没碰了,可能有些东西忘记了,编写、提供最简单的开发环境指导文档和调试文档 14 | 15 | ## Contributing 16 | Email: 82828068 at qq.com 17 | 18 | -------------------------------------------------------------------------------- /release/os/arm/readme.txt: -------------------------------------------------------------------------------- 1 | The ARM version of system. -------------------------------------------------------------------------------- /release/os/i386/bsp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/release/os/i386/bsp.bin -------------------------------------------------------------------------------- /release/os/i386/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/release/os/i386/readme.txt -------------------------------------------------------------------------------- /release/os/mips32/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/release/os/mips32/readme.txt -------------------------------------------------------------------------------- /release/os/mips64/readme.txt: -------------------------------------------------------------------------------- 1 | The MIPS version of system. -------------------------------------------------------------------------------- /release/os/net/stream/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/release/os/net/stream/0 -------------------------------------------------------------------------------- /source/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/Makefile -------------------------------------------------------------------------------- /source/drivers/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/Makefile -------------------------------------------------------------------------------- /source/drivers/base/Makefile: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/config.mk 2 | 3 | OBJS = main.o 4 | 5 | PARTS = buses 6 | 7 | all: subs_parts $(OBJS) 8 | $(LD) -r -o ../hal/base_bus.o *.o $(ARCH_LD_FLAGS) 9 | 10 | include $(MY_BUILD_BASE)/cc.mk 11 | 12 | 13 | -------------------------------------------------------------------------------- /source/drivers/base/buses/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/Makefile -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/Makefile -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/access.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/access.c -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/arch/Makefile -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/mips/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/arch/mips/Makefile -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/mips/init.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/arch/mips/init.c -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/x86/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/arch/x86/Makefile -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/x86/asm/pci.h: -------------------------------------------------------------------------------- 1 | /* 2 | Just make the abstraction layer happy 3 | */ 4 | #ifndef __asm_x86_pci_h__ 5 | #define __asm_x86_pci_h__ 6 | 7 | #include "../pci.h" 8 | 9 | #endif -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/x86/bus_numa.h: -------------------------------------------------------------------------------- 1 | #ifndef __BUS_NUMA_H 2 | #define __BUS_NUMA_H 3 | /* 4 | * sub bus (transparent) will use entres from 3 to store extra from 5 | * root, so need to make sure we have enough slot there. 6 | */ 7 | struct pci_root_res { 8 | struct list_head list; 9 | struct resource res; 10 | }; 11 | 12 | struct pci_root_info { 13 | struct list_head list; 14 | char name[12]; 15 | struct list_head resources; 16 | struct resource busn; 17 | int node; 18 | int link; 19 | }; 20 | 21 | extern struct list_head pci_root_infos; 22 | struct pci_root_info *alloc_pci_root_info(int bus_min, int bus_max, 23 | int node, int link); 24 | extern void update_res(struct pci_root_info *info, resource_size_t start, 25 | resource_size_t end, unsigned long flags, int merge); 26 | #endif 27 | -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/x86/irq.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/arch/x86/irq.c -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/arch/x86/pci_x86.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/arch/x86/pci_x86.h -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/bus.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/bus.c -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/configs.h: -------------------------------------------------------------------------------- 1 | #ifndef PCI_CONFIGS_H 2 | #define PCI_CONFIGS_H 3 | 4 | #define CONFIG_PCI 1 5 | #define CONFIG_PCI_DIRECT 1 6 | 7 | #endif -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/main.c -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/pci-driver.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "pci.h" 4 | 5 | const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, 6 | struct pci_dev *dev) 7 | { 8 | if (ids) { 9 | while (ids->vendor || ids->subvendor || ids->class_mask) { 10 | if (pci_match_one_device(ids, dev)) 11 | return ids; 12 | ids++; 13 | } 14 | } 15 | return NULL; 16 | } 17 | 18 | struct pci_dev *pci_dev_get(struct pci_dev *dev) 19 | { 20 | if (dev) 21 | do_get_device(dev); 22 | 23 | return dev; 24 | } 25 | 26 | DLLEXPORT void pci_dev_put(struct pci_dev *dev) 27 | { 28 | if (dev) 29 | do_put_device(dev); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/pci.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/pci.h -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/probe.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/buses/pci/probe.c -------------------------------------------------------------------------------- /source/drivers/base/buses/pci/setup-bus.c: -------------------------------------------------------------------------------- 1 | unsigned int pci_flags; 2 | -------------------------------------------------------------------------------- /source/drivers/base/kb/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/base/kb/Makefile -------------------------------------------------------------------------------- /source/drivers/base/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | DLLEXPORT bool ke_module_entry(int type) 6 | { 7 | /* PCI init */ 8 | #ifdef __i386__ 9 | // usb_register_quirk(); 10 | 11 | pci_arch_init(); 12 | pci_subsys_init(); 13 | pci_apply_final_quirks();/* Setup the pci_cache_line_size */ 14 | #endif 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source/drivers/bsp/Makefile: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/config.mk 2 | 3 | OBJS = 4 | PARTS = $(ARCH_DIR) 5 | 6 | all: subs_parts $(OBJS) 7 | $(CP) $(ARCH_DIR).o ../hal/ 8 | include $(MY_BUILD_BASE)/cc.mk 9 | -------------------------------------------------------------------------------- /source/drivers/bsp/arm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/arm/Makefile -------------------------------------------------------------------------------- /source/drivers/bsp/arm/include/mach-types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/arm/include/mach-types.h -------------------------------------------------------------------------------- /source/drivers/bsp/arm/include/mach/map.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_MACH_MAP_H 2 | #define __ASM_MACH_MAP_H 3 | 4 | /* MT_DEVICE etc is put to dma_mapping */ 5 | #include 6 | 7 | int arm_bsp_create_map(struct map_desc *map_info, int size); 8 | #endif 9 | -------------------------------------------------------------------------------- /source/drivers/bsp/arm/s3c/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/arm/s3c/Makefile -------------------------------------------------------------------------------- /source/drivers/bsp/arm/s3c/mach-s3c64xx/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/arm/s3c/mach-s3c64xx/Makefile -------------------------------------------------------------------------------- /source/drivers/bsp/arm/s3c/mach-s3c64xx/common.h: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | * 5 | * Wuxin 6 | * ARM S3C6410 Platform initializing 7 | * 8 | */ 9 | 10 | #ifndef __ARCH_ARM_MACH_S3C64XX_COMMON_H 11 | #define __ARCH_ARM_MACH_S3C64XX_COMMON_H 12 | 13 | void s3c64xx_init_io(struct map_desc *mach_desc, int size); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /source/drivers/bsp/arm/s3c/mach-s3c64xx/include/mach/regs-irq.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_ARCH_REGS_IRQ_H 2 | #define __ASM_ARCH_REGS_IRQ_H __FILE__ 3 | 4 | #include 5 | 6 | #endif /* __ASM_ARCH_6400_REGS_IRQ_H */ 7 | -------------------------------------------------------------------------------- /source/drivers/bsp/arm/s3c/mach-s3c64xx/s3cfb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/arm/s3c/mach-s3c64xx/s3cfb.c -------------------------------------------------------------------------------- /source/drivers/bsp/mips/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/mips/Makefile -------------------------------------------------------------------------------- /source/drivers/bsp/mips/jz/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/mips/jz/Makefile -------------------------------------------------------------------------------- /source/drivers/bsp/mips/jz/config.mk: -------------------------------------------------------------------------------- 1 | HAL_INCLUDE += -I$(MY_BUILD_BASE)/source/drivers/bsp/$(ARCH_DIR)/$(PLAT)/soc-4775/include 2 | HAL_INCLUDE += -I$(MY_BUILD_BASE)/source/drivers/bsp/$(ARCH_DIR)/$(PLAT)/core/include 3 | HAL_INCLUDE += -I$(MY_BUILD_BASE)/source/drivers/bsp/$(ARCH_DIR)/plat-generic -------------------------------------------------------------------------------- /source/drivers/bsp/mips/jz/core/include/soc-ver.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_MACH_INGENIC_SOC_VER_H__ 2 | #define __ASM_MACH_INGENIC_SOC_VER_H__ 3 | 4 | #define SOC_JZ4740 40 5 | #define SOC_JZ4750 50 6 | #define SOC_JZ4760 60 7 | #define SOC_JZ4760b 61 8 | #define SOC_JZ4770 70 9 | #define SOC_JZ4780 80 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/drivers/bsp/mips/jz/soc-4775/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/mips/jz/soc-4775/Makefile -------------------------------------------------------------------------------- /source/drivers/bsp/mips/jz/soc-4775/include/irq.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __ASM_MACH_INGENIC_IRQ_H__ 3 | #define __ASM_MACH_INGENIC_IRQ_H__ 4 | 5 | /* IRQ for MIPS CPU */ 6 | #define MIPS_CPU_IRQ_BASE 0 7 | #define IRQ_SMP_RESCHEDULE_YOURSELF 3 8 | #define IRQ_SMP_CALL_FUNCTION 4 9 | 10 | #define INTC_IRQ_BASE 8 11 | 12 | enum { 13 | #define INTC_NR_IRQS 64 14 | IRQ_INTC_BASE = INTC_IRQ_BASE, 15 | IRQ_INTC_END = IRQ_INTC_BASE + INTC_NR_IRQS - 1, 16 | 17 | #define GPIO_NR_IRQS (32*5 + 2*23) 18 | IRQ_GPIO_BASE, 19 | IRQ_GPIO_END = IRQ_GPIO_BASE + GPIO_NR_IRQS - 1, 20 | 21 | #define SADC_NR_IRQS (6) 22 | IRQ_SADC_BASE, 23 | IRQ_SADC_END = IRQ_SADC_BASE + SADC_NR_IRQS - 1, 24 | 25 | #define MCU_NR_IRQS (5) 26 | IRQ_MCU_BASE, 27 | IRQ_MCU_END = IRQ_MCU_BASE + MCU_NR_IRQS - 1, 28 | NR_IRQS, 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /source/drivers/bsp/mips/jz/soc-4775/include/war.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_MACH_INGENIC_WAR_H__ 2 | #define __ASM_MACH_INGENIC_WAR_H__ 3 | 4 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 5 | #define R4600_V1_HIT_CACHEOP_WAR 0 6 | #define R4600_V2_HIT_CACHEOP_WAR 0 7 | #define R5432_CP0_INTERRUPT_WAR 0 8 | #define BCM1250_M3_WAR 0 9 | #define SIBYTE_1956_WAR 0 10 | #define MIPS4K_ICACHE_REFILL_WAR 0 11 | #define MIPS_CACHE_SYNC_WAR 1 12 | #define MIPS_BRIDGE_SYNC_WAR 1 13 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 14 | #define RM9000_CDEX_SMP_WAR 0 15 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 16 | #define R10000_LLSC_WAR 0 17 | #define MIPS34K_MISSED_ITLB_WAR 0 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /source/drivers/bsp/mips/jz/soc-4775/irq.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/mips/jz/soc-4775/irq.c -------------------------------------------------------------------------------- /source/drivers/bsp/mips/loongson/include/boot_param.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PLAT_LOONGSON_BOOT_PARAM_H 3 | #define PLAT_LOONGSON_BOOT_PARAM_H 4 | 5 | /** 6 | @brief SMP base 7 | */ 8 | extern unsigned long smp_group0, smp_group1, smp_group2, smp_group3; 9 | 10 | /** 11 | @brief cpu count 12 | */ 13 | extern unsigned int nr_cpu_loongson; 14 | #endif 15 | -------------------------------------------------------------------------------- /source/drivers/bsp/mips/plat-generic/kernel-entry-init.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __ASM_MACH_MIPS_HAL_ENTRY_H 3 | #define __ASM_MACH_MIPS_HAL_ENTRY_H 4 | 5 | .macro kernel_entry_setup 6 | 7 | .endm 8 | 9 | /* 10 | * Do SMP slave processor setup. 11 | */ 12 | .macro smp_slave_setup 13 | .endm 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /source/drivers/bsp/mips/setup.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_MIPS_PLAT_SETUP_H 2 | #define ARCH_MIPS_PLAT_SETUP_H 3 | 4 | struct video_screen_info; 5 | void plat_setup_screen(struct video_screen_info *screen); 6 | 7 | /** 8 | @brief Setup the irq 9 | */ 10 | void plat_init_irq(); 11 | 12 | /** 13 | @brief setup the smp 14 | */ 15 | void plat_init_smp(); 16 | 17 | /** 18 | @brief Setup the io port base 19 | */ 20 | void plat_setup_ioport(); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /source/drivers/bsp/x86/config.mk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/bsp/x86/config.mk -------------------------------------------------------------------------------- /source/drivers/hal/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/kernel/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/copypage-v6.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct cpu_user_fns { 5 | void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr); 6 | void (*cpu_copy_user_highpage)(struct page *to, struct page *from, 7 | unsigned long vaddr, struct vm_area_struct *vma); 8 | }; 9 | 10 | struct cpu_user_fns v6_user_fns = { 11 | .cpu_clear_user_highpage = 0, 12 | .cpu_copy_user_highpage = 0, 13 | }; 14 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/entry-armv.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/kernel/entry-armv.S -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/fault.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/kernel/fault.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/head.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/kernel/head.S -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/mmu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/kernel/mmu.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/pabort-v6.S: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* 5 | * Function: v6_pabort 6 | * 7 | * Params : r2 = pt_regs 8 | * : r4 = address of aborted instruction 9 | * : r5 = psr for parent context 10 | * 11 | * Returns : r4 - r11, r13 preserved 12 | * 13 | * Purpose : obtain information about current prefetch abort. 14 | */ 15 | 16 | .align 5 17 | ENTRY(v6_pabort) 18 | mov r0, r4 19 | mrc p15, 0, r1, c5, c0, 1 @ get IFSR 20 | b do_PrefetchAbort 21 | ENDPROC(v6_pabort) 22 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/setup.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/kernel/setup.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/kernel/traps.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/kernel/traps.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/lds32.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/lds32.txt -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/lib/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/arm/lib/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/lib/clearbit.S: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "bitops.h" 5 | .text 6 | 7 | bitop _clear_bit, bic 8 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/lib/strchr.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1995-2000 Russell King 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 2 as 6 | * published by the Free Software Foundation. 7 | * 8 | * ASM optimised string functions 9 | */ 10 | #include 11 | #include 12 | 13 | .text 14 | .align 5 15 | ENTRY(strchr) 16 | and r1, r1, #0xff 17 | 1: ldrb r2, [r0], #1 18 | teq r2, r1 19 | teqne r2, #0 20 | bne 1b 21 | teq r2, r1 22 | movne r0, #0 23 | subeq r0, r0, #1 24 | mov pc, lr 25 | ENDPROC(strchr) 26 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/arm/lib/strrchr.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1995-2000 Russell King 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 2 as 6 | * published by the Free Software Foundation. 7 | * 8 | * ASM optimised string functions 9 | */ 10 | #include 11 | #include 12 | 13 | .text 14 | .align 5 15 | ENTRY(strrchr) 16 | mov r3, #0 17 | 1: ldrb r2, [r0], #1 18 | teq r2, r1 19 | subeq r3, r0, #1 20 | teq r2, #0 21 | bne 1b 22 | mov r0, r3 23 | mov pc, lr 24 | ENDPROC(strrchr) 25 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/cpu-probe.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/cpu-probe.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/dma.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int dma_set_mask(struct device *dev, u64 mask) 5 | { 6 | TODO(""); 7 | return -1; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/lds32.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/lds32.txt -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/lds64.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/lds64.txt -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/lib/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/lib/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/mm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/mm/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/mm/c-loongson.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | /* Return the scache size for c-r4k */ 9 | int loongson2_sc_init(void) 10 | { 11 | struct cpuinfo_mips *c = ¤t_cpu_data; 12 | int scache_size; 13 | 14 | scache_size = 512*1024; 15 | c->scache.linesz = 32; 16 | c->scache.ways = 4; 17 | c->scache.waybit = 0; 18 | c->scache.waysize = scache_size / (c->scache.ways); 19 | c->scache.sets = scache_size / (c->scache.linesz * c->scache.ways); 20 | 21 | c->options |= MIPS_CPU_INCLUSIVE_CACHES; 22 | 23 | return scache_size; 24 | } 25 | 26 | static void loongson3_flush_all() 27 | { 28 | } 29 | 30 | static void loongson2_flush_all() 31 | { 32 | r4k_blast_scache(); 33 | } 34 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/mm/cache.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/mm/cache.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/mm/tlb-r4k.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/mm/tlb-r4k.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/2f/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/loongson/2f/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/3a/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/loongson/3a/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/3a/env.c: -------------------------------------------------------------------------------- 1 | 2 | /* HT base default to 3A */ 3 | unsigned long loongson3_ht_control_base = 0x90000EFDFB000000; 4 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/3a/htirq.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/loongson/3a/htirq.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/3a/smp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/loongson/3a/smp.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/loongson/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/irq.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/loongson/irq.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/plat/loongson/setup.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/plat/loongson/setup.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/smp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/smp.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/mips/traps.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/mips/traps.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/apic/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/apic/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/apic/apic.c: -------------------------------------------------------------------------------- 1 | int first_system_vector = 0xfe; 2 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/cpu/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/cpu/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/cpu/amd.c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/cpu/cpu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/cpu/cpu.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/head_32.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/head_32.S -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/i8253.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct clock_event_device *global_clock_event; 5 | 6 | void __init setup_pit_timer(void) 7 | { 8 | clockevent_i8253_init(true); 9 | global_clock_event = &i8253_clockevent; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/i8259.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/i8259.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/irq_32.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | static inline int check_stack_overflow(void) { return 0; } 7 | static inline void print_stack_overflow(void) { } 8 | 9 | /* 10 | * per-CPU IRQ handling contexts (thread information and stack) 11 | */ 12 | bool handle_irq(unsigned irq, struct pt_regs *regs) 13 | { 14 | struct irq_desc *desc; 15 | int overflow; 16 | 17 | overflow = check_stack_overflow(); 18 | 19 | desc = irq_to_desc(irq); 20 | if (unlikely(!desc)) 21 | return false; 22 | 23 | desc->handle_irq(irq, desc); 24 | return true; 25 | } 26 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/lds32.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/lds32.txt -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/lib/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/lib/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/lib/memcpy_32.c: -------------------------------------------------------------------------------- 1 | /* 32bit memset */ 2 | #include 3 | #include 4 | void *memcpy(void *to, const void *from, size_t n) 5 | { 6 | #ifdef CONFIG_X86_USE_3DNOW 7 | return __memcpy3d(to, from, n); 8 | #else 9 | return __memcpy(to, from, n); 10 | #endif 11 | } 12 | 13 | void *memset(void *s, int c, size_t count) 14 | { 15 | return __memset(s, c, count); 16 | } 17 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/main.c -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/misca_32.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/misca_32.S -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/rtc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* Routines for accessing the CMOS RAM/RTC. */ 4 | unsigned char rtc_cmos_read(unsigned char addr) 5 | { 6 | unsigned char val; 7 | 8 | lock_cmos_prefix(addr); 9 | outb(addr, RTC_PORT(0)); 10 | val = inb(RTC_PORT(1)); 11 | lock_cmos_suffix(addr); 12 | 13 | return val; 14 | } 15 | 16 | void rtc_cmos_write(unsigned char val, unsigned char addr) 17 | { 18 | lock_cmos_prefix(addr); 19 | outb(addr, RTC_PORT(0)); 20 | outb(val, RTC_PORT(1)); 21 | lock_cmos_suffix(addr); 22 | } 23 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/smp.c: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | * 5 | * Wuxin 6 | * x86 smp support 7 | */ 8 | 9 | #include 10 | #include 11 | struct smp_ops smp_ops = { 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /source/drivers/hal/arch/x86/traps.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/arch/x86/traps.c -------------------------------------------------------------------------------- /source/drivers/hal/console/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/console/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/console/console.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/console/console.c -------------------------------------------------------------------------------- /source/drivers/hal/console/cursor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/console/cursor.c -------------------------------------------------------------------------------- /source/drivers/hal/console/dotfnt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/console/dotfnt.c -------------------------------------------------------------------------------- /source/drivers/hal/console/internal.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEO_INTERNAL_H 2 | #define VIDEO_INTERNAL_H 3 | 4 | //dotfnt.c 5 | int get_eng_char_width(unsigned char ascii); 6 | int get_chs_char_width(unsigned int gbk_code); 7 | unsigned int draw_eng_char(unsigned char c, int org_x, int org_y, unsigned int color); 8 | unsigned int draw_gbk_chinese(unsigned short gbk_code, int org_x, int org_y, unsigned int color); 9 | 10 | //cursor.h 11 | void console_cursor_toggle(int enable); 12 | void console_cursor_setup(); 13 | void console_cursor_set_height(int h); 14 | void console_cursor_move(unsigned int x, unsigned int y); 15 | 16 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/hal_include.mk: -------------------------------------------------------------------------------- 1 | HAL_INCLUDE = -I$(MY_BUILD_BASE)/source/drivers/hal/include -I$(MY_BUILD_BASE)/source/drivers/hal/include/arch/$(ARCH_DIR) -I$(MY_BUILD_BASE)/source/drivers/hal/include/arch $(CL_INCLUDE) -include hal_config.h 2 | include $(MY_BUILD_BASE)/source/drivers/bsp/$(ARCH_DIR)/$(PLAT)/config.mk -------------------------------------------------------------------------------- /source/drivers/hal/include/acpi_pmtmr.h: -------------------------------------------------------------------------------- 1 | #ifndef _ACPI_PMTMR_H_ 2 | #define _ACPI_PMTMR_H_ 3 | 4 | /* Number of PMTMR ticks expected during calibration run */ 5 | #define PMTMR_TICKS_PER_SEC 3579545 6 | 7 | /* limit it to 24 bits */ 8 | #define ACPI_PM_MASK CLOCKSOURCE_MASK(24) 9 | 10 | /* Overrun value */ 11 | #define ACPI_PM_OVRRUN (1<<24) 12 | 13 | #ifdef CONFIG_X86_PM_TIMER 14 | 15 | extern u32 acpi_pm_read_verified(void); 16 | extern u32 pmtmr_ioport; 17 | 18 | static inline u32 acpi_pm_read_early(void) 19 | { 20 | if (!pmtmr_ioport) 21 | return 0; 22 | /* mask the output to 24 bits */ 23 | return acpi_pm_read_verified() & ACPI_PM_MASK; 24 | } 25 | 26 | #else 27 | 28 | static inline u32 acpi_pm_read_early(void) 29 | { 30 | return 0; 31 | } 32 | 33 | #endif 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/arch.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/abicall.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_ASM_ABICALL_H 2 | #define ARCH_ASM_ABICALL_H 3 | 4 | #define ka_call_dynamic_module_entry(entry, ...) \ 5 | ({ unsigned long __res; \ 6 | __res = (unsigned long)entry(__VA_ARGS__); \ 7 | __res; \ 8 | }) 9 | 10 | 11 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/asm-offsets.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/arm/asm/asm-offsets.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_ARM_COMPILER_H 2 | #define __ASM_ARM_COMPILER_H 3 | 4 | /* 5 | * This is used to ensure the compiler did actually allocate the register we 6 | * asked it for some inline assembly sequences. Apparently we can't trust 7 | * the compiler from one version to another so a bit of paranoia won't hurt. 8 | * This string is meant to be concatenated with the inline asm string and 9 | * will cause compilation to stop on mismatch. 10 | * (for details, see gcc PR 15089) 11 | */ 12 | #define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t" 13 | 14 | 15 | #endif /* __ASM_ARM_COMPILER_H */ 16 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/glue.h: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __STDC__ 3 | #define ____glue(name,fn) name##fn 4 | #else 5 | #define ____glue(name,fn) name/**/fn 6 | #endif 7 | #define __glue(name,fn) ____glue(name,fn) 8 | 9 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/linkage.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_LINKAGE_H 2 | #define __ASM_LINKAGE_H 3 | 4 | #define __ALIGN .align 0 5 | #define __ALIGN_STR ".align 0" 6 | 7 | #define ENDPROC(name) \ 8 | .type name, %function; \ 9 | END(name) 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/mc146818rtc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Machine dependent access functions for RTC registers. 3 | */ 4 | #ifndef _ASM_MC146818RTC_H 5 | #define _ASM_MC146818RTC_H 6 | 7 | #include 8 | 9 | #define RTC_IRQ BUILD_BUG_ON(1) 10 | 11 | #ifndef RTC_PORT 12 | #define RTC_PORT(x) (0x70 + (x)) 13 | #define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */ 14 | #endif 15 | 16 | /* 17 | * The yet supported machines all access the RTC index register via 18 | * an ISA port access but the way to access the date register differs ... 19 | */ 20 | #define CMOS_READ(addr) ({ \ 21 | outb_p((addr),RTC_PORT(0)); \ 22 | inb_p(RTC_PORT(1)); \ 23 | }) 24 | #define CMOS_WRITE(val, addr) ({ \ 25 | outb_p((addr),RTC_PORT(0)); \ 26 | outb_p((val),RTC_PORT(1)); \ 27 | }) 28 | 29 | #endif /* _ASM_MC146818RTC_H */ 30 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/mmu.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_MMU_H 2 | #define __ASM_MMU_H 3 | 4 | struct machine_desc; 5 | 6 | /* HEAD.S */ 7 | void arch_enable_mmu(unsigned long page_table); 8 | 9 | /* MMU.C */ 10 | const struct mem_type *get_mem_type(unsigned int type); 11 | void __init early_paging_init(); 12 | void __init paging_init(); 13 | void *hal_arm_get_init_pgtable(); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/opcodes-virt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __ASM_ARM_OPCODES_VIRT_H 3 | #define __ASM_ARM_OPCODES_VIRT_H 4 | 5 | #include 6 | 7 | #define __HVC(imm16) __inst_arm_thumb32( \ 8 | 0xE1400070 | (((imm16) & 0xFFF0) << 4) | ((imm16) & 0x000F), \ 9 | 0xF7E08000 | (((imm16) & 0xF000) << 4) | ((imm16) & 0x0FFF) \ 10 | ) 11 | 12 | #define __ERET __inst_arm_thumb32( \ 13 | 0xE160006E, \ 14 | 0xF3DE8F00 \ 15 | ) 16 | 17 | #define __MSR_ELR_HYP(regnum) __inst_arm_thumb32( \ 18 | 0xE12EF300 | regnum, \ 19 | 0xF3808E30 | (regnum << 16) \ 20 | ) 21 | 22 | #endif /* ! __ASM_ARM_OPCODES_VIRT_H */ 23 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/param.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/shmparam.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASMARM_SHMPARAM_H 2 | #define _ASMARM_SHMPARAM_H 3 | 4 | /* 5 | * This should be the size of the virtually indexed cache/ways, 6 | * or page size, whichever is greater since the cache aliases 7 | * every size/ways bytes. 8 | */ 9 | #define SHMLBA (4 * PAGE_SIZE) /* attach addr a multiple of this */ 10 | 11 | /* 12 | * Enforce SHMLBA in shmat 13 | */ 14 | #define __ARCH_FORCE_SHMLBA 15 | 16 | #endif /* _ASMARM_SHMPARAM_H */ 17 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/spinlock_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_SPINLOCK_TYPES_H 2 | #define __ASM_SPINLOCK_TYPES_H 3 | 4 | #define TICKET_SHIFT 16 5 | 6 | typedef struct { 7 | union { 8 | u32 slock; 9 | struct __raw_tickets { 10 | #ifdef __ARMEB__ 11 | u16 next; 12 | u16 owner; 13 | #else 14 | u16 owner; 15 | u16 next; 16 | #endif 17 | } tickets; 18 | }; 19 | } arch_spinlock_t; 20 | 21 | #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } 22 | 23 | typedef struct { 24 | volatile unsigned int lock; 25 | } arch_rwlock_t; 26 | 27 | #define __ARCH_RW_LOCK_UNLOCKED { 0 } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/system_info.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_ARM_SYSTEM_INFO_H 2 | #define __ASM_ARM_SYSTEM_INFO_H 3 | 4 | #define CPU_ARCH_UNKNOWN 0 5 | #define CPU_ARCH_ARMv3 1 6 | #define CPU_ARCH_ARMv4 2 7 | #define CPU_ARCH_ARMv4T 3 8 | #define CPU_ARCH_ARMv5 4 9 | #define CPU_ARCH_ARMv5T 5 10 | #define CPU_ARCH_ARMv5TE 6 11 | #define CPU_ARCH_ARMv5TEJ 7 12 | #define CPU_ARCH_ARMv6 8 13 | #define CPU_ARCH_ARMv7 9 14 | 15 | #ifndef __ASSEMBLY__ 16 | 17 | /* information about the system we're running on */ 18 | extern unsigned int system_rev; 19 | extern unsigned int system_serial_low; 20 | extern unsigned int system_serial_high; 21 | extern unsigned int mem_fclk_21285; 22 | 23 | extern int __pure cpu_architecture(void); 24 | 25 | #endif /* !__ASSEMBLY__ */ 26 | 27 | #endif /* __ASM_ARM_SYSTEM_INFO_H */ 28 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/arm/asm/thread.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/timex.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/arm/asm/timex.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/traps.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_TRAPS_H 2 | #define __ASM_TRAPS_H 3 | 4 | extern void __init early_trap_init(void *); 5 | extern void *vectors_page; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/arm/asm/unwind.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __ASM_UNWIND_H 3 | #define __ASM_UNWIND_H 4 | 5 | #ifdef CONFIG_ARM_UNWIND 6 | #define UNWIND(code...) code 7 | #else 8 | #define UNWIND(code...) 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/asm-generic/bitops/ffz.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_GENERIC_BITOPS_FFZ_H_ 2 | #define _ASM_GENERIC_BITOPS_FFZ_H_ 3 | 4 | /* 5 | * ffz - find first zero in word. 6 | * @word: The word to search 7 | * 8 | * Undefined if no zero exists, so code should check against ~0UL first. 9 | */ 10 | #define ffz(x) __ffs(~(x)) 11 | 12 | #endif /* _ASM_GENERIC_BITOPS_FFZ_H_ */ 13 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/asm-generic/param.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_GENERIC_PARAM_H 2 | #define __ASM_GENERIC_PARAM_H 3 | 4 | # define HZ CONFIG_HZ /* Internal kernel timer frequency */ 5 | # define USER_HZ 100 /* some user interfaces are */ 6 | # define CLOCKS_PER_SEC (USER_HZ) /* in "ticks" like times() */ 7 | 8 | 9 | #ifndef HZ 10 | #define HZ 100 11 | #endif 12 | 13 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/abicall.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_ASM_ABICALL_H 2 | #define ARCH_ASM_ABICALL_H 3 | /************************************************************************/ 4 | /* MISC */ 5 | /************************************************************************/ 6 | #define ka_call_dynamic_module_entry(entry, ...) \ 7 | ({ unsigned long __res; \ 8 | /* Set prologue */ \ 9 | __asm__ __volatile__( \ 10 | ".set\tnoreorder\n\t" \ 11 | "move\t$t9,%0 \t\n" \ 12 | ".set\treorder\n\t" \ 13 | :: "Jr"(entry): "t9", "memory" \ 14 | ); \ 15 | \ 16 | __res = (unsigned long)entry(__VA_ARGS__); \ 17 | }) 18 | 19 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/asm-offsets.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/mips/asm/asm-offsets.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/bitops.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/mips/asm/bitops.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/bug.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_BUG_H 2 | #define __ASM_BUG_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef CONFIG_BUG 8 | 9 | #include 10 | #include 11 | 12 | #endif 13 | 14 | #include 15 | 16 | #endif /* __ASM_BUG_H */ 17 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/cache.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_CACHE_H 2 | #define _ASM_CACHE_H 3 | 4 | #define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT 5 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 6 | 7 | #define SMP_CACHE_SHIFT L1_CACHE_SHIFT 8 | #define SMP_CACHE_BYTES L1_CACHE_BYTES 9 | 10 | #endif /* _ASM_CACHE_H */ 11 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/cacheflush.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/mips/asm/cacheflush.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/cpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/mips/asm/cpu.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/delay.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_DELAY_H 2 | #define _ASM_DELAY_H 3 | 4 | extern void __delay(unsigned long loops); 5 | extern void __ndelay(unsigned long ns); 6 | extern void __udelay(unsigned long us); 7 | 8 | #define ndelay(ns) __ndelay(ns) 9 | #define udelay(us) __udelay(us) 10 | 11 | /* make sure "usecs *= ..." in udelay do not overflow. */ 12 | #if HZ >= 1000 13 | #define MAX_UDELAY_MS 1 14 | #elif HZ <= 200 15 | #define MAX_UDELAY_MS 5 16 | #else 17 | #define MAX_UDELAY_MS (1000 / HZ) 18 | #endif 19 | 20 | #endif /* _ASM_DELAY_H */ 21 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/dma-mapping.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_DMA_MAPPING_H 2 | #define __ASM_DMA_MAPPING_H 3 | extern int dma_set_mask(struct device *dev, u64 mask); 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/fpu.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_FPU_H 2 | #define _ASM_FPU_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | #define __enable_fpu() \ 12 | do { \ 13 | set_c0_status(ST0_CU1); \ 14 | enable_fpu_hazard(); \ 15 | } while (0) 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/hardirq.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_HARDIRQ_H 2 | #define _ASM_HARDIRQ_H 3 | 4 | extern void ack_bad_irq(unsigned int irq); 5 | #define ack_bad_irq ack_bad_irq 6 | 7 | #include 8 | 9 | #endif /* _ASM_HARDIRQ_H */ 10 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/hw_irq.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_HW_IRQ_H 2 | #define __ASM_HW_IRQ_H 3 | 4 | #include 5 | 6 | extern atomic_t irq_err_count; 7 | 8 | /* 9 | * interrupt-retrigger: NOP for now. This may not be appropriate for all 10 | * machines, we'll see ... 11 | */ 12 | 13 | #endif /* __ASM_HW_IRQ_H */ 14 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/irq.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/mips/asm/irq.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/irq_cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_IRQ_CPU_H 2 | #define _ASM_IRQ_CPU_H 3 | 4 | extern void mips_cpu_irq_init(void); 5 | #endif /* _ASM_IRQ_CPU_H */ 6 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/linkage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/mips/asm/linkage.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/mc146818rtc.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_MC146818RTC_H 2 | #define _ASM_MC146818RTC_H 3 | 4 | #include 5 | 6 | #endif /* _ASM_MC146818RTC_H */ 7 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/param.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_PARAM_H 2 | #define _ASM_PARAM_H 3 | 4 | #include 5 | 6 | #endif /* _ASM_PARAM_H */ 7 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/sections.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_SECTIONS_H 2 | #define _ASM_SECTIONS_H 3 | 4 | #include 5 | 6 | #endif /* _ASM_SECTIONS_H */ 7 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/sgidefs.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_SGIDEFS_H 2 | #define __ASM_SGIDEFS_H 3 | 4 | /* 5 | * Definitions for the ISA levels 6 | * 7 | * With the introduction of MIPS32 / MIPS64 instruction sets definitions 8 | * MIPS ISAs are no longer subsets of each other. Therefore comparisons 9 | * on these symbols except with == may result in unexpected results and 10 | * are forbidden! 11 | */ 12 | #define _MIPS_ISA_MIPS1 1 13 | #define _MIPS_ISA_MIPS2 2 14 | #define _MIPS_ISA_MIPS3 3 15 | #define _MIPS_ISA_MIPS4 4 16 | #define _MIPS_ISA_MIPS5 5 17 | #define _MIPS_ISA_MIPS32 6 18 | #define _MIPS_ISA_MIPS64 7 19 | 20 | /* 21 | * Subprogram calling convention 22 | */ 23 | #define _MIPS_SIM_ABI32 1 24 | #define _MIPS_SIM_NABI32 2 25 | #define _MIPS_SIM_ABI64 3 26 | 27 | #endif /* __ASM_SGIDEFS_H */ 28 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/spinlock_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_SPINLOCK_TYPES_H 2 | #define _ASM_SPINLOCK_TYPES_H 3 | 4 | typedef union { 5 | /* 6 | * bits 0..15 : serving_now 7 | * bits 16..31 : ticket 8 | */ 9 | u32 lock; 10 | struct { 11 | #ifdef __BIG_ENDIAN 12 | u16 ticket; 13 | u16 serving_now; 14 | #else 15 | u16 serving_now; 16 | u16 ticket; 17 | #endif 18 | } h; 19 | } arch_spinlock_t; 20 | 21 | #define __ARCH_SPIN_LOCK_UNLOCKED { 0 } 22 | 23 | typedef struct { 24 | volatile unsigned int lock; 25 | } arch_rwlock_t; 26 | 27 | #define __ARCH_RW_LOCK_UNLOCKED { 0 } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/spram.h: -------------------------------------------------------------------------------- 1 | #ifndef _MIPS_SPRAM_H 2 | #define _MIPS_SPRAM_H 3 | 4 | #ifdef CONFIG_CPU_MIPSR2 5 | extern __init void spram_config(void); 6 | #else 7 | static inline void spram_config(void) { }; 8 | #endif /* CONFIG_CPU_MIPSR2 */ 9 | 10 | #endif /* _MIPS_SPRAM_H */ 11 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/mips/asm/thread.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/watch.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ASM_WATCH_H 3 | #define _ASM_WATCH_H 4 | 5 | #include 6 | 7 | void mips_install_watch_registers(void); 8 | void mips_read_watch_registers(void); 9 | void mips_clear_watch_registers(void); 10 | void mips_probe_watch_registers(struct cpuinfo_mips *c); 11 | 12 | #ifdef CONFIG_HARDWARE_WATCHPOINTS 13 | #define __restore_watch() do { \ 14 | if (unlikely(test_bit(TIF_LOAD_WATCH, \ 15 | ¤t_thread_info()->flags))) { \ 16 | mips_install_watch_registers(); \ 17 | } \ 18 | } while (0) 19 | 20 | #else 21 | #define __restore_watch() do {} while (0) 22 | #endif 23 | 24 | #endif /* _ASM_WATCH_H */ 25 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/mips/asm/wbflush.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ASM_WBFLUSH_H 3 | #define _ASM_WBFLUSH_H 4 | 5 | 6 | #ifdef CONFIG_CPU_HAS_WB 7 | 8 | extern void (*__wbflush)(void); 9 | extern void wbflush_setup(void); 10 | 11 | #define wbflush() \ 12 | do { \ 13 | __sync(); \ 14 | __wbflush(); \ 15 | } while (0) 16 | 17 | #else /* !CONFIG_CPU_HAS_WB */ 18 | 19 | #define wbflush_setup() do { } while (0) 20 | 21 | #define wbflush() fast_iob() 22 | 23 | #endif /* !CONFIG_CPU_HAS_WB */ 24 | 25 | #endif /* _ASM_WBFLUSH_H */ 26 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/abicall.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_ASM_ABICALL_H 2 | #define ARCH_ASM_ABICALL_H 3 | 4 | #define ka_call_dynamic_module_entry(entry, ...) \ 5 | ({ unsigned long __res; \ 6 | __res = (unsigned long)entry(__VA_ARGS__); \ 7 | __res ; \ 8 | }) 9 | 10 | 11 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/alternative-asm.h: -------------------------------------------------------------------------------- 1 | #ifdef __ASSEMBLY__ 2 | 3 | #include 4 | 5 | #ifdef CONFIG_SMP 6 | .macro LOCK_PREFIX 7 | 1: lock 8 | .section .smp_locks,"a" 9 | .balign 4 10 | .long 1b - . 11 | .previous 12 | .endm 13 | #else 14 | .macro LOCK_PREFIX 15 | .endm 16 | #endif 17 | 18 | .macro altinstruction_entry orig alt feature orig_len alt_len 19 | .long \orig - . 20 | .long \alt - . 21 | .word \feature 22 | .byte \orig_len 23 | .byte \alt_len 24 | .endm 25 | 26 | #endif /* __ASSEMBLY__ */ 27 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/apic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/apic.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/apicdef.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/apicdef.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/atomic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/atomic.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/cache.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_CACHE_H 2 | #define _ASM_X86_CACHE_H 3 | 4 | #include 5 | 6 | /* L1 cache line size */ 7 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 9 | 10 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) 11 | 12 | #define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT 13 | #define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT) 14 | 15 | #ifdef CONFIG_X86_VSMP 16 | #ifdef CONFIG_SMP 17 | #define __cacheline_aligned_in_smp \ 18 | __attribute__((__aligned__(INTERNODE_CACHE_BYTES))) \ 19 | __page_aligned_data 20 | #endif 21 | #endif 22 | 23 | #endif /* _ASM_X86_CACHE_H */ 24 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/delay.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_DELAY_H 2 | #define _ASM_X86_DELAY_H 3 | 4 | #include 5 | 6 | void use_tsc_delay(void); 7 | 8 | #endif /* _ASM_X86_DELAY_H */ 9 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/fixmap.h: -------------------------------------------------------------------------------- 1 | #ifndef X86_FIXMAP_H 2 | #define X86_FIXMAP_H 3 | 4 | enum fixed_addresses { 5 | FIX_APIC_BASE, 6 | __end_of_fixed_addresses 7 | }; 8 | 9 | #define FIXADDR_TOP 0xfffff000 10 | 11 | #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) 12 | #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) 13 | 14 | static __always_inline unsigned long fix_to_virt(const unsigned int idx) 15 | { 16 | if (idx >= __end_of_fixed_addresses) 17 | return 0; 18 | 19 | return __fix_to_virt(idx); 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/frame.h: -------------------------------------------------------------------------------- 1 | #ifdef __ASSEMBLY__ 2 | 3 | #include 4 | #include 5 | 6 | .macro FRAME 7 | .endm 8 | .macro ENDFRAME 9 | .endm 10 | #endif /* __ASSEMBLY__ */ 11 | 12 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/hw_irq.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_HW_IRQ_H 2 | #define __ASM_HW_IRQ_H 3 | 4 | #include 5 | 6 | extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECTOR])(void); 7 | 8 | typedef int vector_irq_t[NR_VECTORS]; 9 | extern vector_irq_t vector_irq; 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/i387.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_I387_H 2 | #define _ASM_X86_I387_H 3 | 4 | extern void fpu_init(void); 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/io.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/io.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/iommu.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_IOMMU_H 2 | #define _ASM_X86_IOMMU_H 3 | 4 | extern struct dma_map_ops nommu_dma_ops; 5 | extern int force_iommu, no_iommu; 6 | extern int iommu_detected; 7 | extern int iommu_pass_through; 8 | 9 | /* 10 seconds */ 10 | #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) 11 | 12 | #endif /* _ASM_X86_IOMMU_H */ 13 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/irq.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_IRQ_H 2 | #define ARCH_IRQ_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | //irq_32/64.c 9 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); 10 | 11 | //irq.c 12 | asmregparm unsigned int do_IRQ(struct pt_regs *regs); 13 | extern atomic_t irq_err_count; 14 | 15 | //i8259.c 16 | extern void init_ISA_irqs(void); 17 | 18 | //irqinit.c 19 | extern void native_init_IRQ(void); 20 | extern void arch_init_irq(); 21 | 22 | 23 | #endif /* ARCH_IRQ_H */ 24 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/linkage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/linkage.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/mce.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_MCE_H 2 | #define _ASM_X86_MCE_H 3 | 4 | #ifdef CONFIG_X86_MCE 5 | int mcheck_init(void); 6 | void mcheck_cpu_init(struct cpuinfo_x86 *c); 7 | #else 8 | static inline int mcheck_init(void) { return 0; } 9 | static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {} 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/mpspec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/mpspec.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/param.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/pci_x86.h: -------------------------------------------------------------------------------- 1 | 2 | #define PCI_PROBE_BIOS 0x0001 3 | #define PCI_PROBE_CONF1 0x0002 4 | #define PCI_PROBE_CONF2 0x0004 5 | #define PCI_PROBE_MMCONF 0x0008 6 | #define PCI_PROBE_MASK 0x000f 7 | #define PCI_PROBE_NOEARLY 0x0010 8 | 9 | extern unsigned int pci_probe; 10 | 11 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/processor_probe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/processor_probe.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/serial.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_SERIAL_H 2 | #define _ASM_X86_SERIAL_H 3 | 4 | void x86_serial_init(); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/smp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/smp.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/spinlock_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_SPINLOCK_TYPES_H 2 | #define _ASM_X86_SPINLOCK_TYPES_H 3 | 4 | #if (CONFIG_NR_CPUS < 256) 5 | typedef u8 __ticket_t; 6 | typedef u16 __ticketpair_t; 7 | #else 8 | typedef u16 __ticket_t; 9 | typedef u32 __ticketpair_t; 10 | #endif 11 | 12 | #define TICKET_SHIFT (sizeof(__ticket_t) * 8) 13 | 14 | typedef struct arch_spinlock { 15 | union { 16 | __ticketpair_t head_tail; 17 | struct __raw_tickets { 18 | __ticket_t head, tail; 19 | } tickets; 20 | }; 21 | } arch_spinlock_t; 22 | 23 | #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } 24 | 25 | #include 26 | 27 | 28 | #endif /* _ASM_X86_SPINLOCK_TYPES_H */ 29 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/arch/x86/asm/thread.h -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/timex.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_X86_TIMEX_H 2 | #define _ASM_X86_TIMEX_H 3 | 4 | 5 | /* Assume we use the PIT time source for the clock tick */ 6 | #define CLOCK_TICK_RATE PIT_TICK_RATE 7 | 8 | /* Merged the original time.h */ 9 | #include 10 | #include 11 | 12 | extern void hpet_time_init(void); 13 | extern void time_init(void); 14 | 15 | extern struct clock_event_device *global_clock_event; 16 | 17 | #endif /* _ASM_X86_TIMEX_H */ 18 | -------------------------------------------------------------------------------- /source/drivers/hal/include/arch/x86/asm/tlbflush.h: -------------------------------------------------------------------------------- 1 | /* 2 | TLB ops 3 | */ 4 | #ifndef _ARCH_TLB_H 5 | #define _ARCH_TLB_H 6 | #include "processor.h" 7 | 8 | static inline void __native_flush_tlb_single(unsigned long addr) 9 | { 10 | asm volatile("invlpg (%0)" ::"r" (addr) : "memory"); 11 | } 12 | static inline void __native_flush_tlb(void) 13 | { 14 | native_write_cr3(native_read_cr3()); 15 | } 16 | #define __flush_tlb_single(addr) __native_flush_tlb_single(addr) 17 | #define __flush_tlb() __native_flush_tlb() 18 | 19 | static inline void __flush_tlb_one(unsigned long addr) 20 | { 21 | if (cpu_has_invlpg) 22 | __flush_tlb_single(addr); 23 | else 24 | __flush_tlb(); 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /source/drivers/hal/include/atomic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/atomic.h -------------------------------------------------------------------------------- /source/drivers/hal/include/bcd.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_BCD_H 2 | #define HAL_BCD_H 3 | 4 | #define bcd2bin(x) const_bcd2bin(x) 5 | #define bin2bcd(x) const_bin2bcd(x) 6 | 7 | #define const_bcd2bin(x) (((x) & 0x0f) + ((x) >> 4) * 10) 8 | #define const_bin2bcd(x) ((((x) / 10) << 4) + (x) % 10) 9 | 10 | #endif /* HAL_BCD_H */ 11 | -------------------------------------------------------------------------------- /source/drivers/hal/include/bitops.h: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | * 5 | * Wuxin 6 | * BITOPS 7 | */ 8 | #ifndef HAL_BITOPS_H 9 | #define HAL_BITOPS_H 10 | 11 | #define BIT(nr) (1UL << (nr)) 12 | #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) 13 | #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) 14 | #define BITS_PER_BYTE 8 15 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) 16 | 17 | #include 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /source/drivers/hal/include/cache.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/cache.h -------------------------------------------------------------------------------- /source/drivers/hal/include/clocksource.h: -------------------------------------------------------------------------------- 1 | extern void 2 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); 3 | -------------------------------------------------------------------------------- /source/drivers/hal/include/compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/compiler.h -------------------------------------------------------------------------------- /source/drivers/hal/include/console.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/console.h -------------------------------------------------------------------------------- /source/drivers/hal/include/const.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONST_H 2 | #define __CONST_H 3 | 4 | /* Some constant macros are used in both assembler and 5 | * C code. Therefore we cannot annotate them always with 6 | * 'UL' and other type specifiers unilaterally. We 7 | * use the following macros to deal with this. 8 | * 9 | * Similarly, _AT() will cast an expression with a type in C, but 10 | * leave it unchanged in asm. 11 | */ 12 | 13 | #ifdef __ASSEMBLY__ 14 | #define _AC(X,Y) X 15 | #define _AT(T,X) X 16 | #else 17 | #define __AC(X,Y) (X##Y) 18 | #define _AC(X,Y) __AC(X,Y) 19 | #define _AT(T,X) ((T)(X)) 20 | #endif 21 | 22 | #endif /* !() */ 23 | -------------------------------------------------------------------------------- /source/drivers/hal/include/debug.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /source/drivers/hal/include/delay.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_DELAY_H 2 | #define HAL_DELAY_H 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /source/drivers/hal/include/hal_config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/hal_config.h -------------------------------------------------------------------------------- /source/drivers/hal/include/hardirq.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/hardirq.h -------------------------------------------------------------------------------- /source/drivers/hal/include/i8253.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_I8253_H 2 | #define HAL_I8253_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | /* i8253A PIT registers */ 9 | #define PIT_MODE 0x43 10 | #define PIT_CH0 0x40 11 | #define PIT_CH2 0x42 12 | 13 | /* The clock frequency of the i8253/i8254 PIT */ 14 | #define PIT_TICK_RATE 1193182ul 15 | #define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ) 16 | 17 | extern raw_spinlock_t i8253_lock; 18 | extern struct clock_event_device i8253_clockevent; 19 | extern void clockevent_i8253_init(bool oneshot); 20 | 21 | extern void setup_pit_timer(void); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /source/drivers/hal/include/irq.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/irq.h -------------------------------------------------------------------------------- /source/drivers/hal/include/linkage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/linkage.h -------------------------------------------------------------------------------- /source/drivers/hal/include/misc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/misc.h -------------------------------------------------------------------------------- /source/drivers/hal/include/param.h: -------------------------------------------------------------------------------- 1 | #ifndef _PARAM_H_ 2 | #define _PARAM_H_ 3 | 4 | #include 5 | 6 | #define HZ CONFIG_HZ /* Internal kernel timer frequency */ 7 | 8 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/percpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/percpu.h -------------------------------------------------------------------------------- /source/drivers/hal/include/preempt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/preempt.h -------------------------------------------------------------------------------- /source/drivers/hal/include/readme.txt: -------------------------------------------------------------------------------- 1 | The file used by the hal layer. 2 | Wuxin -------------------------------------------------------------------------------- /source/drivers/hal/include/rtc.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_RTC_H 2 | #define HAL_RTC_H 3 | 4 | struct rtc_time { 5 | int tm_sec; 6 | int tm_min; 7 | int tm_hour; 8 | int tm_mday; 9 | int tm_mon; 10 | int tm_year; 11 | int tm_wday; 12 | int tm_yday; 13 | int tm_isdst; 14 | }; 15 | 16 | int rtc_init(void); 17 | 18 | /* interrupt flags */ 19 | #define RTC_IRQF 0x80 /* Any of the following is active */ 20 | #define RTC_PF 0x40 /* Periodic interrupt */ 21 | #define RTC_AF 0x20 /* Alarm interrupt */ 22 | #define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */ 23 | #define RTC_MAX_FREQ 8192 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /source/drivers/hal/include/smp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | * 5 | * 6 | * HAL SMP 7 | */ 8 | 9 | #ifndef HAL_SMP_H 10 | #define HAL_SMP_H 11 | 12 | #include "preempt.h" 13 | 14 | static inline int raw_smp_processor_id() 15 | { 16 | //TODO to support smp 17 | return 0; 18 | } 19 | #define smp_processor_id() raw_smp_processor_id() 20 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) 21 | #define put_cpu() preempt_enable() 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /source/drivers/hal/include/spinlock.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/spinlock.h -------------------------------------------------------------------------------- /source/drivers/hal/include/string.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/include/string.h -------------------------------------------------------------------------------- /source/drivers/hal/include/stringify.h: -------------------------------------------------------------------------------- 1 | #ifndef ___STRINGIFY_H 2 | #define ___STRINGIFY_H 3 | 4 | 5 | #define __stringify_1(x...) #x 6 | #define __stringify(x...) __stringify_1(x) 7 | 8 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/time.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_TIME_H 2 | #define HAL_TIME_H 3 | 4 | #include 5 | 6 | /* Parameters used to convert the timespec values: */ 7 | #define MSEC_PER_SEC 1000L 8 | #define USEC_PER_MSEC 1000L 9 | #define NSEC_PER_USEC 1000L 10 | #define NSEC_PER_MSEC 1000000L 11 | #define USEC_PER_SEC 1000000L 12 | #define NSEC_PER_SEC 1000000000L 13 | #define FSEC_PER_SEC 1000000000000000LL 14 | 15 | extern void (*late_time_init)(void); 16 | 17 | #define KTIME_MAX ((s64)~((u64)1 << 63)) 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /source/drivers/hal/include/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_TIMER_H 2 | #define HAL_TIMER_H 3 | 4 | void __init hal_timer_system_init(void); 5 | extern void run_local_timers(void); 6 | 7 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/topology.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_TOPOLOGY_H 2 | #define HAL_TOPOLOGY_H 3 | 4 | #ifndef cpu_to_node 5 | #define cpu_to_node(cpu) ((void)(cpu),0) 6 | #endif 7 | 8 | #endif -------------------------------------------------------------------------------- /source/drivers/hal/include/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | */ 5 | 6 | #ifndef HAL_TYPES_H 7 | #define HAL_TYPES_H 8 | #include 9 | 10 | #include_next 11 | 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /source/drivers/hal/irq/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/irq/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/irq/chip.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/irq/chip.c -------------------------------------------------------------------------------- /source/drivers/hal/irq/dpc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/irq/dpc.c -------------------------------------------------------------------------------- /source/drivers/hal/irq/handle.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/irq/handle.c -------------------------------------------------------------------------------- /source/drivers/hal/irq/manage.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/irq/manage.c -------------------------------------------------------------------------------- /source/drivers/hal/irq/resend.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "internals.h" 4 | 5 | /* 6 | * IRQ resend 7 | * 8 | * Is called with interrupts disabled and desc->lock held. 9 | */ 10 | void check_irq_resend(struct irq_desc *desc, unsigned int irq) 11 | { 12 | /* 13 | * We do not resend level type interrupts. Level type 14 | * interrupts are resent by hardware when they are still 15 | * active. 16 | */ 17 | if (irq_settings_is_level(desc)) 18 | return; 19 | if (desc->istate & IRQS_REPLAY) 20 | return; 21 | if (desc->istate & IRQS_PENDING) { 22 | desc->istate &= ~IRQS_PENDING; 23 | desc->istate |= IRQS_REPLAY; 24 | 25 | if (!desc->irq_data.chip->irq_retrigger || 26 | !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) { 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /source/drivers/hal/libs/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/libs/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/libs/printk.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/libs/printk.c -------------------------------------------------------------------------------- /source/drivers/hal/main/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/main/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/main/bootmod.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/main/bootmod.c -------------------------------------------------------------------------------- /source/drivers/hal/main/devres.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/main/devres.c -------------------------------------------------------------------------------- /source/drivers/hal/main/interface.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/main/interface.c -------------------------------------------------------------------------------- /source/drivers/hal/main/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/main/main.c -------------------------------------------------------------------------------- /source/drivers/hal/main/obj.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/main/obj.c -------------------------------------------------------------------------------- /source/drivers/hal/main/resource.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/main/resource.c -------------------------------------------------------------------------------- /source/drivers/hal/problem list.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/problem list.txt -------------------------------------------------------------------------------- /source/drivers/hal/time/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/time/Makefile -------------------------------------------------------------------------------- /source/drivers/hal/time/rtc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/time/rtc.c -------------------------------------------------------------------------------- /source/drivers/hal/time/tick-common.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void tick_handle_periodic(struct clock_event_device *dev) 6 | { 7 | jiffies_64++; 8 | run_local_timers(); 9 | } -------------------------------------------------------------------------------- /source/drivers/hal/time/time.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/time/time.c -------------------------------------------------------------------------------- /source/drivers/hal/time/timer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/drivers/hal/time/timer.c -------------------------------------------------------------------------------- /source/initloader/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | # See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | # 5 | 6 | 7 | include ../../config.mk 8 | 9 | my_cflags += -fno-builtin 10 | 11 | OBJS = loader.o \ 12 | elf.o \ 13 | utils.o 14 | 15 | ASM_OBJS= start.o 16 | 17 | TARGET = initloader 18 | 19 | all: $(OBJS) $(ASM_OBJS) 20 | $(LD) -nostdlib -T ldr.lds -o $(TARGET) $(ASM_OBJS) $(OBJS) 21 | 22 | include ../../cc.mk -------------------------------------------------------------------------------- /source/initloader/ReadMe: -------------------------------------------------------------------------------- 1 | InitLoader 2 | 3 | 基于GRUB装载器,负责收集GRUB产生的信息包括如下: 4 | 内存布局列表,Int 15h, Function e820的内存映射列表; 5 | 模块装载列表 6 | 显示模式:VESA信息 7 | 启动设备;磁盘编号Int 13h编号。 8 | 9 | 王树浩 10 | -------------------------------------------------------------------------------- /source/initloader/ldr.lds: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | */ 5 | 6 | ENTRY(_start) 7 | 8 | SECTIONS { 9 | . = 0x110000; 10 | 11 | .text : {*(.text)} 12 | .rodata : {*(.rodata)} 13 | .data : {*(.data)} 14 | .bss : {*(.bss)} 15 | .comm : {*(.comm)} 16 | } 17 | -------------------------------------------------------------------------------- /source/initloader/utils.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/initloader/utils.c -------------------------------------------------------------------------------- /source/initloader/utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | */ 5 | 6 | #ifndef UTILS_H 7 | #define UTILS_H 8 | 9 | 10 | void* alloc_startup_args_mem(size_t size); 11 | 12 | int __strlen(const char *str); 13 | int __strcmp(const char *s1, const char *s2); 14 | void __strcpy(char *dst, char *src); 15 | 16 | void cls (void); 17 | void printf (const char *format, ...); 18 | 19 | #endif /* UTILS_H */ 20 | 21 | -------------------------------------------------------------------------------- /source/kernel/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/Makefile -------------------------------------------------------------------------------- /source/kernel/arch/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/Makefile -------------------------------------------------------------------------------- /source/kernel/arch/arm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/arm/Makefile -------------------------------------------------------------------------------- /source/kernel/arch/arm/thread.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/arm/thread.c -------------------------------------------------------------------------------- /source/kernel/arch/mips/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/mips/Makefile -------------------------------------------------------------------------------- /source/kernel/arch/mips/fault.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/mips/fault.c -------------------------------------------------------------------------------- /source/kernel/arch/mips/page.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/mips/page.c -------------------------------------------------------------------------------- /source/kernel/arch/mips/setup.c: -------------------------------------------------------------------------------- 1 | 2 | unsigned long kernelsp[NR_CPUS]; 3 | 4 | void kma_setup() 5 | { 6 | extern void mips_setup_traps();//traps.c 7 | 8 | mips_setup_traps(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /source/kernel/arch/mips/thread.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/mips/thread.c -------------------------------------------------------------------------------- /source/kernel/arch/mips/traps.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/mips/traps.c -------------------------------------------------------------------------------- /source/kernel/arch/x86/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/x86/Makefile -------------------------------------------------------------------------------- /source/kernel/arch/x86/page.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/x86/page.c -------------------------------------------------------------------------------- /source/kernel/arch/x86/thread.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/x86/thread.c -------------------------------------------------------------------------------- /source/kernel/arch/x86/tss.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/arch/x86/tss.c -------------------------------------------------------------------------------- /source/kernel/atomic.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/atomic.c -------------------------------------------------------------------------------- /source/kernel/complete.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/complete.c -------------------------------------------------------------------------------- /source/kernel/cpu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/cpu.c -------------------------------------------------------------------------------- /source/kernel/cs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/cs.c -------------------------------------------------------------------------------- /source/kernel/ddk_for_drv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/ddk_for_drv.c -------------------------------------------------------------------------------- /source/kernel/handle.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/handle.c -------------------------------------------------------------------------------- /source/kernel/include/arch/arm/arch/pgtable-2level-types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ASM_PGTABLE_2LEVEL_TYPES_H 3 | #define _ASM_PGTABLE_2LEVEL_TYPES_H 4 | 5 | #ifndef __ASSEMBLER__ 6 | #include 7 | #endif 8 | 9 | typedef u32 pteval_t; 10 | typedef u32 pmdval_t; 11 | 12 | typedef pteval_t pgprot_t; 13 | #define ARCH_HAS_PTE_T 14 | typedef unsigned long pte_t; 15 | 16 | #define pgprot_val(x) (x) 17 | #define __pgprot(x) (x) 18 | 19 | /* Level 2's format */ 20 | typedef struct lv2_entry 21 | { 22 | unsigned long odd, even; 23 | } lv2_entry_t; 24 | 25 | #define PTE_HWTABLE_PTRS (ARCH_KM_LV1_COUNT) 26 | #define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t)) 27 | #define PTE_HWTABLE_SIZE (PTE_HWTABLE_PTRS * sizeof(u32)) 28 | 29 | #endif /* _ASM_PGTABLE_2LEVEL_TYPES_H */ 30 | -------------------------------------------------------------------------------- /source/kernel/include/arch/arm/arch/pgtable-hwdef.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ASMARM_PGTABLE_HWDEF_H 3 | #define _ASMARM_PGTABLE_HWDEF_H 4 | 5 | #ifdef CONFIG_ARM_LPAE 6 | #include "pgtable-3level-hwdef.h" 7 | #else 8 | #include "pgtable-2level-hwdef.h" 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/kernel/include/arch/arm/arch/thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/arch/arm/arch/thread.h -------------------------------------------------------------------------------- /source/kernel/include/arch/arm/arch/walk-2level.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/arch/arm/arch/walk-2level.h -------------------------------------------------------------------------------- /source/kernel/include/arch/mips/arch/page.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/arch/mips/arch/page.h -------------------------------------------------------------------------------- /source/kernel/include/arch/mips/arch/walk.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/arch/mips/arch/walk.h -------------------------------------------------------------------------------- /source/kernel/include/arch/x86/arch/page.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/arch/x86/arch/page.h -------------------------------------------------------------------------------- /source/kernel/include/arch/x86/arch/thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/arch/x86/arch/thread.h -------------------------------------------------------------------------------- /source/kernel/include/cpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/cpu.h -------------------------------------------------------------------------------- /source/kernel/include/exe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/exe.h -------------------------------------------------------------------------------- /source/kernel/include/handle.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/handle.h -------------------------------------------------------------------------------- /source/kernel/include/memory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/memory.h -------------------------------------------------------------------------------- /source/kernel/include/msg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/msg.h -------------------------------------------------------------------------------- /source/kernel/include/page.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/page.h -------------------------------------------------------------------------------- /source/kernel/include/priority.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/priority.h -------------------------------------------------------------------------------- /source/kernel/include/process.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/process.h -------------------------------------------------------------------------------- /source/kernel/include/section.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/section.h -------------------------------------------------------------------------------- /source/kernel/include/sync.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/sync.h -------------------------------------------------------------------------------- /source/kernel/include/thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/thread.h -------------------------------------------------------------------------------- /source/kernel/include/walk.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/include/walk.h -------------------------------------------------------------------------------- /source/kernel/kernel.mk: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/source/drivers/hal/hal_include.mk 2 | 3 | ADD_INCLUDE +=-I$(MY_BUILD_BASE)/source/kernel/include/arch/$(ARCH_DIR) -I$(MY_BUILD_BASE)/source/kernel/include -------------------------------------------------------------------------------- /source/kernel/lock.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/lock.c -------------------------------------------------------------------------------- /source/kernel/memory/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/Makefile -------------------------------------------------------------------------------- /source/kernel/memory/ctx.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/ctx.c -------------------------------------------------------------------------------- /source/kernel/memory/debug.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/debug.c -------------------------------------------------------------------------------- /source/kernel/memory/exp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/exp.c -------------------------------------------------------------------------------- /source/kernel/memory/pa.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/pa.c -------------------------------------------------------------------------------- /source/kernel/memory/page.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/page.c -------------------------------------------------------------------------------- /source/kernel/memory/percpu.c: -------------------------------------------------------------------------------- 1 | #include "cpu.h" 2 | 3 | void __init km_setup_percpu(int cpu, unsigned long base) 4 | { 5 | hal_arch_setup_percpu(cpu, base); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /source/kernel/memory/section.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/section.c -------------------------------------------------------------------------------- /source/kernel/memory/valloc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/valloc.c -------------------------------------------------------------------------------- /source/kernel/memory/vm.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/vm.c -------------------------------------------------------------------------------- /source/kernel/memory/walk.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/memory/walk.c -------------------------------------------------------------------------------- /source/kernel/mutex.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/mutex.c -------------------------------------------------------------------------------- /source/kernel/object.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/object.c -------------------------------------------------------------------------------- /source/kernel/process/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/Makefile -------------------------------------------------------------------------------- /source/kernel/process/debug.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/debug.c -------------------------------------------------------------------------------- /source/kernel/process/exe.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/exe.c -------------------------------------------------------------------------------- /source/kernel/process/msg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/msg.c -------------------------------------------------------------------------------- /source/kernel/process/process.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/process.c -------------------------------------------------------------------------------- /source/kernel/process/sched.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/sched.c -------------------------------------------------------------------------------- /source/kernel/process/sleep.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/sleep.c -------------------------------------------------------------------------------- /source/kernel/process/sync.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/sync.c -------------------------------------------------------------------------------- /source/kernel/process/thread.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/process/thread.c -------------------------------------------------------------------------------- /source/kernel/srv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/kernel/srv.c -------------------------------------------------------------------------------- /source/libs/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/Makefile -------------------------------------------------------------------------------- /source/libs/c++/Makefile: -------------------------------------------------------------------------------- 1 | DLL =yes 2 | 3 | include $(MY_BUILD_BASE)/config.mk 4 | CC = $(GCC_PREFIX)g++ 5 | TARGET = libgrdc++.a 6 | DEPENDS = -lgrid -lhead_so.o 7 | PARTS = cxxabi libsupc++ 8 | OBJS = 9 | ADD_INCLUDE = 10 | all: subs_parts $(OBJS) 11 | $(AR) -r $(TARGET) *.o 12 | $(CP) $(TARGET) $(SYSTEM_DIR) 13 | 14 | include $(MY_BUILD_BASE)/cc.mk 15 | 16 | 17 | -------------------------------------------------------------------------------- /source/libs/c++/cxxabi/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/c++/cxxabi/Makefile -------------------------------------------------------------------------------- /source/libs/c++/cxxabi/unwind-dw2-fde-darwin.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/c++/cxxabi/unwind-dw2-fde-darwin.c -------------------------------------------------------------------------------- /source/libs/c++/cxxabi/unwind-dw2.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/c++/cxxabi/unwind-dw2.c -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/c++/libsupc++/Makefile -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/del_op.cc: -------------------------------------------------------------------------------- 1 | // Boilerplate support routines for -*- C++ -*- dynamic memory management. 2 | 3 | 4 | #include "new" 5 | #include 6 | #if _GLIBCXX_HOSTED 7 | #include 8 | #endif 9 | 10 | #if _GLIBCXX_HOSTED 11 | using std::free; 12 | #else 13 | // A freestanding C runtime may not provide "free" -- but there is no 14 | // other reasonable way to implement "operator delete". 15 | extern "C" void free(void *); 16 | #endif 17 | 18 | _GLIBCXX_WEAK_DEFINITION void 19 | operator delete (void *ptr) throw () 20 | { 21 | if (ptr) 22 | free (ptr); 23 | } 24 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/del_opnt.cc: -------------------------------------------------------------------------------- 1 | // Boilerplate support routines for -*- C++ -*- dynamic memory management. 2 | 3 | 4 | #include "new" 5 | #include 6 | 7 | extern "C" void free (void *); 8 | 9 | _GLIBCXX_WEAK_DEFINITION void 10 | operator delete (void *ptr, const std::nothrow_t&) throw () 11 | { 12 | if (ptr) 13 | free (ptr); 14 | } 15 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/del_opv.cc: -------------------------------------------------------------------------------- 1 | // Boilerplate support routines for -*- C++ -*- dynamic memory management. 2 | 3 | 4 | #include "new" 5 | #include 6 | 7 | _GLIBCXX_WEAK_DEFINITION void 8 | operator delete[] (void *ptr) throw () 9 | { 10 | ::operator delete (ptr); 11 | } 12 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/del_opvnt.cc: -------------------------------------------------------------------------------- 1 | // Boilerplate support routines for -*- C++ -*- dynamic memory management. 2 | 3 | 4 | #include "new" 5 | #include 6 | 7 | _GLIBCXX_WEAK_DEFINITION void 8 | operator delete[] (void *ptr, const std::nothrow_t&) throw () 9 | { 10 | ::operator delete (ptr); 11 | } 12 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/eh_aux_runtime.cc: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- Common throw conditions. 2 | 3 | #include "typeinfo" 4 | #include "exception" 5 | #include 6 | #include "unwind-cxx.h" 7 | #include "exception_defines.h" 8 | 9 | extern "C" void 10 | __cxxabiv1::__cxa_bad_cast () 11 | { 12 | #ifdef __EXCEPTIONS 13 | throw std::bad_cast(); 14 | #else 15 | std::abort(); 16 | #endif 17 | } 18 | 19 | extern "C" void 20 | __cxxabiv1::__cxa_bad_typeid () 21 | { 22 | #ifdef __EXCEPTIONS 23 | throw std::bad_typeid(); 24 | #else 25 | std::abort(); 26 | #endif 27 | } 28 | 29 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/eh_exception.cc: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- std::exception implementation. 2 | 3 | 4 | 5 | #include "typeinfo" 6 | #include "exception" 7 | #include "unwind-cxx.h" 8 | 9 | std::exception::~exception() throw() { } 10 | 11 | std::bad_exception::~bad_exception() throw() { } 12 | 13 | const char* 14 | std::exception::what() const throw() 15 | { 16 | return typeid (*this).name (); 17 | } 18 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/eh_type.cc: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- Exception handling routines for catching. 2 | 3 | #include 4 | #include 5 | #include "unwind-cxx.h" 6 | 7 | namespace __cxxabiv1 8 | { 9 | 10 | // Returns the type_info for the currently handled exception [15.3/8], or 11 | // null if there is none. 12 | extern "C" 13 | std::type_info *__cxa_current_exception_type () 14 | { 15 | __cxa_eh_globals *globals = __cxa_get_globals (); 16 | __cxa_exception *header = globals->caughtExceptions; 17 | if (header) 18 | return header->exceptionType; 19 | else 20 | return 0; 21 | } 22 | 23 | } // namespace __cxxabiv1 24 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/eh_unex_handler.cc: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- std::unexpected handler 2 | 3 | #include "unwind-cxx.h" 4 | 5 | /* The current installed user handler. */ 6 | std::unexpected_handler __cxxabiv1::__unexpected_handler = std::terminate; 7 | 8 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/new_handler.cc: -------------------------------------------------------------------------------- 1 | // Implementation file for the -*- C++ -*- dynamic memory management header. 2 | 3 | #include "new" 4 | 5 | const std::nothrow_t std::nothrow = { }; 6 | 7 | using std::new_handler; 8 | new_handler __new_handler; 9 | 10 | new_handler 11 | std::set_new_handler (new_handler handler) throw() 12 | { 13 | new_handler prev_handler = __new_handler; 14 | __new_handler = handler; 15 | return prev_handler; 16 | } 17 | 18 | std::bad_alloc::~bad_alloc() throw() { } 19 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/new_opv.cc: -------------------------------------------------------------------------------- 1 | // Boilerplate support routines for -*- C++ -*- dynamic memory management. 2 | 3 | #include "new" 4 | #include 5 | 6 | _GLIBCXX_WEAK_DEFINITION void* 7 | operator new[] (std::size_t sz) throw (std::bad_alloc) 8 | { 9 | return ::operator new(sz); 10 | } 11 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/new_opvnt.cc: -------------------------------------------------------------------------------- 1 | // Boilerplate support routines for -*- C++ -*- dynamic memory management. 2 | 3 | #include "new" 4 | #include 5 | 6 | _GLIBCXX_WEAK_DEFINITION void* 7 | operator new[] (std::size_t sz, const std::nothrow_t& nothrow) throw() 8 | { 9 | return ::operator new(sz, nothrow); 10 | } 11 | -------------------------------------------------------------------------------- /source/libs/c++/libsupc++/tinfo.h: -------------------------------------------------------------------------------- 1 | // RTTI support internals for -*- C++ -*- 2 | 3 | #include "typeinfo" 4 | #include 5 | 6 | // Class declarations shared between the typeinfo implementation files. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /source/libs/common/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/Makefile -------------------------------------------------------------------------------- /source/libs/common/blkbuf.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/blkbuf.c -------------------------------------------------------------------------------- /source/libs/common/cpu/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/cpu/Makefile -------------------------------------------------------------------------------- /source/libs/common/cpu/atomic.c: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | * 5 | * wuxin 6 | * atomic 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | void cl_atomic_inc(struct ke_atomic *atomic) 13 | { 14 | atomic_inc((atomic_t*)atomic); 15 | } 16 | 17 | void cl_atomic_dec(struct ke_atomic *atomic) 18 | { 19 | atomic_dec((atomic_t*)atomic); 20 | } 21 | -------------------------------------------------------------------------------- /source/libs/common/cpu/bitmap.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/cpu/bitmap.c -------------------------------------------------------------------------------- /source/libs/common/i2p.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/i2p.c -------------------------------------------------------------------------------- /source/libs/common/include/arch/arm/cl_string.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/arch/arm/cl_string.h -------------------------------------------------------------------------------- /source/libs/common/include/arch/x86/cl_string.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __i386__ 4 | # include "string_32.h" 5 | #else 6 | # include "string_64.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /source/libs/common/include/bitmap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/bitmap.h -------------------------------------------------------------------------------- /source/libs/common/include/bits.h: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | * 5 | * wuxin 6 | * λ 7 | */ 8 | #ifndef COMMON_LIB_BITS_H 9 | #define COMMON_LIB_BITS_H 10 | #include 11 | 12 | extern unsigned long cl_find_next_zero_bit(const unsigned long *addr, unsigned long size, 13 | unsigned long offset); 14 | 15 | extern unsigned long cl_find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset); 16 | 17 | extern unsigned long find_last_bit(const unsigned long *addr, unsigned long size); 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /source/libs/common/include/blkbuf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/blkbuf.h -------------------------------------------------------------------------------- /source/libs/common/include/cl_atomic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/cl_atomic.h -------------------------------------------------------------------------------- /source/libs/common/include/cl_fname.h: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | * 5 | * wuxin 6 | * 7 | */ 8 | 9 | #ifndef CL_FNAME_H 10 | #define CL_FNAME_H 11 | 12 | const char *cl_locate_pure_file_name(const char *fname); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /source/libs/common/include/digits.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/digits.h -------------------------------------------------------------------------------- /source/libs/common/include/exefmt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/exefmt.h -------------------------------------------------------------------------------- /source/libs/common/include/i2p.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/i2p.h -------------------------------------------------------------------------------- /source/libs/common/include/memalloc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/memalloc.h -------------------------------------------------------------------------------- /source/libs/common/include/message.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/message.h -------------------------------------------------------------------------------- /source/libs/common/include/object.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/object.h -------------------------------------------------------------------------------- /source/libs/common/include/ring_buff.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/include/ring_buff.h -------------------------------------------------------------------------------- /source/libs/common/malloc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/malloc.c -------------------------------------------------------------------------------- /source/libs/common/misc/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/misc/Makefile -------------------------------------------------------------------------------- /source/libs/common/misc/fname.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/misc/fname.c -------------------------------------------------------------------------------- /source/libs/common/misc/h2d.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/misc/h2d.c -------------------------------------------------------------------------------- /source/libs/common/misc/vsprintf.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/misc/vsprintf.c -------------------------------------------------------------------------------- /source/libs/common/msg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/msg.c -------------------------------------------------------------------------------- /source/libs/common/object/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/object/Makefile -------------------------------------------------------------------------------- /source/libs/common/object/name.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/object/name.c -------------------------------------------------------------------------------- /source/libs/common/object/object.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/object/object.c -------------------------------------------------------------------------------- /source/libs/common/object/type.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/object/type.c -------------------------------------------------------------------------------- /source/libs/common/ring_buff.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/common/ring_buff.c -------------------------------------------------------------------------------- /source/libs/elf2/elf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/elf2/elf.h -------------------------------------------------------------------------------- /source/libs/grid/Makefile: -------------------------------------------------------------------------------- 1 | DLL=yes 2 | include $(MY_BUILD_BASE)/config.mk 3 | 4 | OBJS = main.o fd.o 5 | TARGET = grid.so 6 | DEPENDS = -lhead_so.o 7 | #DEPENDS +=../../pthread/pthread.o 8 | DEPENDS += $(SYSTEM_BUILD_TMP)/libs/$(ARCH_DIR)/common.o$(DLL) $(SYSTEM_BUILD_TMP)/libs/$(ARCH_DIR)/elf.o$(DLL) 9 | ADD_INCLUDE +=-I./include $(CL_INCLUDE) 10 | LDFLAGS +=-Ttext-segment=0x70000000 -init dll_preinit 11 | PARTS = crt0 dlfun malloc string stdlib stdio socket dirent sys arch 12 | 13 | all: subs_parts $(OBJS) 14 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(ADD_LIBS) $(ARCH_LD_FLAGS) 15 | $(CP) $(TARGET) $(SYSTEM_DIR) 16 | 17 | include $(MY_BUILD_BASE)/cc.mk 18 | 19 | 20 | -------------------------------------------------------------------------------- /source/libs/grid/arch/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/Makefile -------------------------------------------------------------------------------- /source/libs/grid/arch/arm/32/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/arm/32/Makefile -------------------------------------------------------------------------------- /source/libs/grid/arch/arm/32/def.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_DEF_H 2 | #define ARCH_DEF_H 3 | 4 | # ifndef LOCK 5 | # ifdef UP 6 | # define LOCK 7 | # else 8 | # define LOCK lock 9 | # endif 10 | # endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /source/libs/grid/arch/arm/32/pthread_spin_init.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void pthread_spin_init() 4 | { 5 | TODO(""); 6 | } 7 | 8 | void pthread_spin_lock() 9 | { 10 | TODO(""); 11 | } 12 | 13 | void pthread_spin_unlock() 14 | { 15 | TODO(""); 16 | } 17 | -------------------------------------------------------------------------------- /source/libs/grid/arch/arm/32/pthread_spin_lock.S: -------------------------------------------------------------------------------- 1 | #include "def.h" 2 | 3 | .globl pthread_spin_lock 4 | .type pthread_spin_lock,@function 5 | .align 16 6 | pthread_spin_lock: 7 | .size pthread_spin_lock,.-pthread_spin_lock 8 | -------------------------------------------------------------------------------- /source/libs/grid/arch/arm/32/pthread_spin_unlock.S: -------------------------------------------------------------------------------- 1 | .globl pthread_spin_unlock 2 | .type pthread_spin_unlock,@function 3 | .align 16 4 | pthread_spin_unlock: 5 | movl 4(%esp), %eax 6 | movl $1, (%eax) 7 | xorl %eax, %eax 8 | ret 9 | .size pthread_spin_unlock,.-pthread_spin_unlock 10 | 11 | /* The implementation of pthread_spin_init is identical. */ 12 | .globl pthread_spin_init 13 | pthread_spin_init = pthread_spin_unlock 14 | -------------------------------------------------------------------------------- /source/libs/grid/arch/arm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/arm/Makefile -------------------------------------------------------------------------------- /source/libs/grid/arch/mips/32/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/mips/32/Makefile -------------------------------------------------------------------------------- /source/libs/grid/arch/mips/32/def.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_DEF_H 2 | #define ARCH_DEF_H 3 | 4 | # ifndef LOCK 5 | # ifdef UP 6 | # define LOCK 7 | # else 8 | # define LOCK lock 9 | # endif 10 | # endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /source/libs/grid/arch/mips/32/pthread_spin_init.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void pthread_spin_init() 4 | { 5 | TODO(""); 6 | } 7 | 8 | void pthread_spin_lock() 9 | { 10 | TODO(""); 11 | } 12 | 13 | void pthread_spin_unlock() 14 | { 15 | TODO(""); 16 | } 17 | -------------------------------------------------------------------------------- /source/libs/grid/arch/mips/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/mips/Makefile -------------------------------------------------------------------------------- /source/libs/grid/arch/x86/32/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/x86/32/Makefile -------------------------------------------------------------------------------- /source/libs/grid/arch/x86/32/def.h: -------------------------------------------------------------------------------- 1 | #ifndef ARCH_DEF_H 2 | #define ARCH_DEF_H 3 | 4 | # ifndef LOCK 5 | # ifdef UP 6 | # define LOCK 7 | # else 8 | # define LOCK lock 9 | # endif 10 | # endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /source/libs/grid/arch/x86/32/pthread_spin_init.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/x86/32/pthread_spin_init.c -------------------------------------------------------------------------------- /source/libs/grid/arch/x86/32/pthread_spin_lock.S: -------------------------------------------------------------------------------- 1 | #include "def.h" 2 | 3 | .globl pthread_spin_lock 4 | .type pthread_spin_lock,@function 5 | .align 16 6 | pthread_spin_lock: 7 | mov 4(%esp), %eax 8 | 1: LOCK 9 | decl 0(%eax) 10 | jne 2f 11 | xor %eax, %eax 12 | ret 13 | 14 | .align 16 15 | 2: rep 16 | nop 17 | cmpl $0, 0(%eax) 18 | jg 1b 19 | jmp 2b 20 | .size pthread_spin_lock,.-pthread_spin_lock 21 | -------------------------------------------------------------------------------- /source/libs/grid/arch/x86/32/pthread_spin_unlock.S: -------------------------------------------------------------------------------- 1 | .globl pthread_spin_unlock 2 | .type pthread_spin_unlock,@function 3 | .align 16 4 | pthread_spin_unlock: 5 | movl 4(%esp), %eax 6 | movl $1, (%eax) 7 | xorl %eax, %eax 8 | ret 9 | .size pthread_spin_unlock,.-pthread_spin_unlock 10 | 11 | /* The implementation of pthread_spin_init is identical. */ 12 | .globl pthread_spin_init 13 | pthread_spin_init = pthread_spin_unlock 14 | -------------------------------------------------------------------------------- /source/libs/grid/arch/x86/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/arch/x86/Makefile -------------------------------------------------------------------------------- /source/libs/grid/crt0/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | make -f exe.mk 3 | make -f so.mk 4 | clean: 5 | rm -f *.o 6 | -------------------------------------------------------------------------------- /source/libs/grid/crt0/exe.mk: -------------------------------------------------------------------------------- 1 | NORMAL_APP=yes 2 | include $(MY_BUILD_BASE)/config.mk 3 | 4 | OBJS = head_exe.o 5 | LAST_INCLUDE +=-I../include 6 | PARTS = 7 | 8 | all: subs_parts $(OBJS) 9 | $(CP) $(OBJS) $(SYSTEM_DIR) 10 | 11 | include $(MY_BUILD_BASE)/cc.mk 12 | 13 | -------------------------------------------------------------------------------- /source/libs/grid/crt0/head_exe.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/crt0/head_exe.c -------------------------------------------------------------------------------- /source/libs/grid/crt0/head_so.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | extern int dll_main(int argc, char ** argv); 5 | 6 | void _start(unsigned long para) 7 | { 8 | dll_main(0, 0); 9 | } -------------------------------------------------------------------------------- /source/libs/grid/crt0/so.mk: -------------------------------------------------------------------------------- 1 | DLL=yes 2 | include $(MY_BUILD_BASE)/config.mk 3 | 4 | OBJS = head_so.o 5 | LAST_INCLUDE +=-I../include 6 | PARTS = 7 | 8 | all: subs_parts $(OBJS) 9 | $(CP) $(OBJS) $(SYSTEM_DIR) 10 | 11 | include $(MY_BUILD_BASE)/cc.mk 12 | 13 | -------------------------------------------------------------------------------- /source/libs/grid/dirent/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/dirent/Makefile -------------------------------------------------------------------------------- /source/libs/grid/dirent/closedir.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix directory API 7 | Yaosihai,ZhaoYu 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "posix.h" 14 | #include "file.h" 15 | #include "dir.h" 16 | 17 | DLLEXPORT int closedir (DIR *dirp) 18 | { 19 | /* See opendir */ 20 | if (dirp->dir_buffer) 21 | crt_free(dirp->dir_buffer); 22 | sys_close(dirp->dir_handle); 23 | crt_free(dirp); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /source/libs/grid/dirent/opendir.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/dirent/opendir.c -------------------------------------------------------------------------------- /source/libs/grid/dirent/readdir.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/dirent/readdir.c -------------------------------------------------------------------------------- /source/libs/grid/dlfun/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/dlfun/Makefile -------------------------------------------------------------------------------- /source/libs/grid/dlfun/dl_crt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/dlfun/dl_crt.c -------------------------------------------------------------------------------- /source/libs/grid/dlfun/dladdr.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix shared object operations 7 | Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "posix.h" 15 | #include "dlfcn.h" 16 | 17 | DLLEXPORT int dladdr(void * address, Dl_info * info) 18 | { 19 | TODO(""); 20 | set_errno(ENOSYS); 21 | return 0; 22 | } 23 | 24 | DLLEXPORT void *dlsection_vaddr(void *handle, const char *section_name, size_t *size) 25 | { 26 | if (handle == GLOBAL_HANDLE) 27 | return NULL; 28 | 29 | return dl_section_vaddress(handle, section_name, size); 30 | } -------------------------------------------------------------------------------- /source/libs/grid/dlfun/dlclose.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix shared object operations 7 | Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "posix.h" 15 | 16 | #include "dlfcn.h" 17 | 18 | DLLEXPORT int dlclose(void *handle) 19 | { 20 | if (handle == GLOBAL_HANDLE) 21 | return POSIX_FAILED; 22 | 23 | dl_close(handle); 24 | 25 | return POSIX_SUCCESS; 26 | } 27 | -------------------------------------------------------------------------------- /source/libs/grid/dlfun/dlerr.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix shared object operations 7 | Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "dlfcn.h" 14 | 15 | char *dlerror(void) 16 | { 17 | TODO(""); 18 | return NULL; 19 | } -------------------------------------------------------------------------------- /source/libs/grid/dlfun/dlfcn.h: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix shared object operations 7 | Yaosihai 8 | */ 9 | 10 | #ifndef _DLFCN_H 11 | #define _DLFCN_H 12 | 13 | #define GLOBAL_HANDLE (void*)1 14 | 15 | /* dlopen.c */ 16 | bool init_module(); 17 | 18 | /* dl_crt.c */ 19 | void dl_handle_over(void *old_dl); 20 | void *dl_open(const char *name, int mode); 21 | bool dl_close(void *handle); 22 | void *dl_sym(void *handle, const char *name); 23 | void *dl_entry(void *handle); 24 | void dl_call_posix_entry(void *entry, int argc, char *argv[]); 25 | void *dl_section_vaddress(void *handle, const char *name, size_t *size); 26 | #endif -------------------------------------------------------------------------------- /source/libs/grid/dlfun/dlopen.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix shared object operations 7 | Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "posix.h" 15 | 16 | #include "dlfcn.h" 17 | 18 | bool init_module() 19 | { 20 | return true; 21 | } 22 | 23 | DLLEXPORT void *dlopen(const char *file, int mode) 24 | { 25 | if (!file) 26 | return GLOBAL_HANDLE; 27 | 28 | return dl_open(file, mode); 29 | } 30 | 31 | DLLEXPORT void dlcall_posix_entry(void *entry, int argc, char *argv[]) 32 | { 33 | dl_call_posix_entry(entry, argc, argv); 34 | } 35 | -------------------------------------------------------------------------------- /source/libs/grid/dlfun/dlsym.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/dlfun/dlsym.c -------------------------------------------------------------------------------- /source/libs/grid/dlfun/lazy.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/dlfun/lazy.S -------------------------------------------------------------------------------- /source/libs/grid/include/dir.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/dir.h -------------------------------------------------------------------------------- /source/libs/grid/include/env.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/env.h -------------------------------------------------------------------------------- /source/libs/grid/include/file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/file.h -------------------------------------------------------------------------------- /source/libs/grid/include/nocache_file.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | @brief 4 | no cache file operation 5 | */ 6 | 7 | #ifndef __NOCACHE_FILE_H__ 8 | #define __NOCACHE_FILE_H__ 9 | 10 | #include 11 | 12 | 13 | 14 | 15 | /* 16 | @brief 17 | init nocache file operation 18 | @return 19 | void 20 | */ 21 | void nocache_file_init_ops(struct file *filp); 22 | 23 | #endif 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /source/libs/grid/include/posix.h: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | The most common definition 7 | Yaosihai 8 | */ 9 | 10 | #ifndef __CRT_POSIX_H 11 | #define __CRT_POSIX_H 12 | 13 | #include "crt.h" 14 | 15 | /* End char size for string */ 16 | #define POSIX_END_CHAR_SIZE 1 17 | 18 | /* Used when open failed for posix file */ 19 | #define POSIX_INVALID_FD (-1) 20 | 21 | /* Return value */ 22 | #define POSIX_FAILED (-1) 23 | #define POSIX_SUCCESS 0 24 | 25 | void *posix_fd_translate(int fd); 26 | void posix_fd_deinit(); 27 | bool posix_fd_init(); 28 | bool posix_fd_deallocate(int fd); 29 | int posix_fd_allocate(void *object); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /source/libs/grid/include/socket_file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/socket_file.h -------------------------------------------------------------------------------- /source/libs/grid/include/std_console.h: -------------------------------------------------------------------------------- 1 | #ifndef STANDARD_CONSOLE_H 2 | #define STANDARD_CONSOLE_H 3 | 4 | int stdin_read(unsigned long *key); 5 | int stdout_write(char *buf, size_t size); 6 | 7 | #endif -------------------------------------------------------------------------------- /source/libs/grid/include/stream_file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/stream_file.h -------------------------------------------------------------------------------- /source/libs/grid/include/sys/file_req.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/sys/file_req.h -------------------------------------------------------------------------------- /source/libs/grid/include/sys/net_req.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/sys/net_req.h -------------------------------------------------------------------------------- /source/libs/grid/include/sys/session_req.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/sys/session_req.h -------------------------------------------------------------------------------- /source/libs/grid/include/sys/syscall.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/include/sys/syscall.h -------------------------------------------------------------------------------- /source/libs/grid/include/sys/sysdep.h: -------------------------------------------------------------------------------- 1 | 2 | #define BP_SYM(name) _BP_SYM (name) 3 | #if __BOUNDED_POINTERS__ 4 | # define _BP_SYM(name) __BP_##name 5 | #else 6 | # define _BP_SYM(name) name 7 | #endif 8 | 9 | #ifdef __ASSEMBLER__ 10 | 11 | /* Used by some assembly code. */ 12 | #ifdef NO_UNDERSCORES 13 | #define C_SYMBOL_NAME(name) name 14 | #define C_LABEL(name) name##: 15 | #else 16 | #define C_SYMBOL_NAME(name) _##name 17 | #define C_LABEL(name) _##name##: 18 | #endif 19 | 20 | #endif -------------------------------------------------------------------------------- /source/libs/grid/malloc/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/malloc/Makefile -------------------------------------------------------------------------------- /source/libs/grid/malloc/malloc.h: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix memory allocation 7 | Yaosihai 8 | */ 9 | 10 | #ifndef _MALLOC_H 11 | #define _MALLOC_H 12 | 13 | bool init_malloc(); 14 | 15 | #endif -------------------------------------------------------------------------------- /source/libs/grid/malloc/mmap.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/malloc/mmap.c -------------------------------------------------------------------------------- /source/libs/grid/socket/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/socket/Makefile -------------------------------------------------------------------------------- /source/libs/grid/socket/af_inet.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/socket/af_inet.c -------------------------------------------------------------------------------- /source/libs/grid/socket/af_unix.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/socket/af_unix.c -------------------------------------------------------------------------------- /source/libs/grid/stdio/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdio/Makefile -------------------------------------------------------------------------------- /source/libs/grid/stdio/fclose.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix file 7 | ZhaoYu,Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "stream_file.h" 14 | 15 | DLLEXPORT int fclose(FILE *file) 16 | { 17 | struct file *filp = file_get_from_detail(file); 18 | 19 | return filp->ops->close(filp); 20 | } -------------------------------------------------------------------------------- /source/libs/grid/stdio/fopen.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdio/fopen.c -------------------------------------------------------------------------------- /source/libs/grid/stdio/fread.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix file 7 | ZhaoYu,Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "stream_file.h" 14 | 15 | DLLEXPORT size_t fread(void *ptr, size_t size, size_t nmemb, FILE *file) 16 | { 17 | int i, ret; 18 | size_t items = 0; 19 | struct file *filp = file_get_from_detail(file); 20 | 21 | for (i = 0; i < nmemb; i++) 22 | { 23 | ret = filp->ops->read(filp, ptr, size); 24 | if (0 >= ret) 25 | break; 26 | else 27 | { 28 | items++; 29 | ptr = (unsigned char*)ptr + size; 30 | } 31 | } 32 | 33 | return items; 34 | } -------------------------------------------------------------------------------- /source/libs/grid/stdio/ftruncate.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdio/ftruncate.c -------------------------------------------------------------------------------- /source/libs/grid/stdio/fwrite.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix file 7 | ZhaoYu,Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "stream_file.h" 14 | 15 | DLLEXPORT size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *file) 16 | { 17 | printf("%s", ptr); 18 | } 19 | -------------------------------------------------------------------------------- /source/libs/grid/stdio/getch.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | Posix file 7 | ZhaoYu,Yaosihai 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | DLLEXPORT int getch() 14 | { 15 | unsigned long key = 0; 16 | 17 | int ret = stdin_read(&key); 18 | if (ret < 0) 19 | return ret; 20 | //printf("getch %d, %d\n", ret, key); 21 | return key; 22 | } -------------------------------------------------------------------------------- /source/libs/grid/stdio/nocache_file.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdio/nocache_file.c -------------------------------------------------------------------------------- /source/libs/grid/stdio/printf.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdio/printf.c -------------------------------------------------------------------------------- /source/libs/grid/stdio/stream_file.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdio/stream_file.c -------------------------------------------------------------------------------- /source/libs/grid/stdlib/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdlib/Makefile -------------------------------------------------------------------------------- /source/libs/grid/stdlib/abort.c: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * for abor() 4 | */ 5 | #include 6 | #include 7 | 8 | DLLEXPORT void abort(void) 9 | { 10 | printf("Abort function TODO\n"); 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /source/libs/grid/stdlib/chdir.c: -------------------------------------------------------------------------------- 1 | /** 2 | * See the readme.txt at the root directory of this project for the idea and originality of this operating system. 3 | * See the license.txt at the root directory of this project for the copyright information about this file and project. 4 | */ 5 | 6 | /** 7 | The Grid Core Library 8 | 9 | Posix environment API 10 | Wuxin (82828068@qq.com) 11 | */ 12 | #include 13 | #include 14 | #include 15 | 16 | #include "sys/ke_req.h" 17 | 18 | DLLEXPORT int chdir(const char *path) 19 | { 20 | TODO(""); 21 | return -1; 22 | } -------------------------------------------------------------------------------- /source/libs/grid/stdlib/getenv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdlib/getenv.c -------------------------------------------------------------------------------- /source/libs/grid/stdlib/setenv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/stdlib/setenv.c -------------------------------------------------------------------------------- /source/libs/grid/string/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/string/Makefile -------------------------------------------------------------------------------- /source/libs/grid/string/memcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DLLEXPORT __weak int memcmp(const void *cs, const void *ct, size_t count) 5 | { 6 | const unsigned char *su1, *su2; 7 | int res = 0; 8 | 9 | for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 10 | if ((res = *su1 - *su2) != 0) 11 | break; 12 | return res; 13 | } -------------------------------------------------------------------------------- /source/libs/grid/string/memcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | DLLEXPORT __weak void *memcpy(void *dst, const void *src, unsigned long len) 4 | { 5 | void *ret = dst; 6 | 7 | while(len--) 8 | { 9 | *(char *)dst = *(char *)src; 10 | 11 | dst = (char *)dst + 1; 12 | src = (char *)src + 1; 13 | } 14 | 15 | return ret; 16 | } 17 | 18 | DLLEXPORT __weak void *memset(void *dst, int value, unsigned long count) 19 | { 20 | void *start = dst; 21 | 22 | while (count--) 23 | { 24 | *(char *)dst = (char)value; 25 | dst = (char *)dst + 1; 26 | } 27 | 28 | return start; 29 | } 30 | -------------------------------------------------------------------------------- /source/libs/grid/string/strcat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DLLEXPORT __weak char *strcat(char *dest, const char *src) 5 | { 6 | char *tmp = dest; 7 | 8 | while (*dest) 9 | dest++; 10 | while ((*dest++ = *src++) != '\0') 11 | ; 12 | return tmp; 13 | } -------------------------------------------------------------------------------- /source/libs/grid/string/strchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DLLEXPORT __weak char * strchr (const char * string, int ch) 5 | { 6 | while (*string && *string != (char)ch) 7 | string++; 8 | 9 | if (*string == (char)ch) 10 | return((char *)string); 11 | return(NULL); 12 | } -------------------------------------------------------------------------------- /source/libs/grid/string/strcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | DLLEXPORT __weak int strcmp(const char *src1, const char *src2) 4 | { 5 | int ret = 0 ; 6 | 7 | while(!(ret = *(unsigned char *)src1 - *(unsigned char *)src2) && *src1) 8 | { 9 | ++src1, ++src2; 10 | } 11 | 12 | if (ret < 0) 13 | { 14 | ret = -1 ; 15 | } 16 | else if (ret > 0) 17 | { 18 | ret = 1 ; 19 | } 20 | 21 | return ret; 22 | } 23 | -------------------------------------------------------------------------------- /source/libs/grid/string/strcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | DLLEXPORT __weak char *strcpy (char *dest, const char *src) 4 | { 5 | char *s = dest; 6 | 7 | while ((*dest++ = *src++) != '\0') 8 | ; 9 | 10 | return s; 11 | } 12 | -------------------------------------------------------------------------------- /source/libs/grid/string/strlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | DLLEXPORT __weak unsigned long strlen(const char * str) 6 | { 7 | const char *eos = str; 8 | 9 | while (*eos++); 10 | 11 | return (eos - str - 1); 12 | } 13 | -------------------------------------------------------------------------------- /source/libs/grid/string/strncmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DLLEXPORT __weak int strncmp (const char *s1, const char *s2, size_t n) 5 | { 6 | if (n == 0) 7 | return 0; 8 | 9 | while (n-- != 0 && *s1 == *s2) 10 | { 11 | if (n == 0 || *s1 == '\0' || *s2 == '\0') 12 | break; 13 | s1++; 14 | s2++; 15 | } 16 | 17 | return (*(unsigned char *) s1) - (*(unsigned char *) s2); 18 | } 19 | -------------------------------------------------------------------------------- /source/libs/grid/string/strncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | DLLEXPORT __weak char *strncpy (char *dest, const char *src, int len) 5 | { 6 | char *s = dest; 7 | 8 | while ((len--) && (*dest++ = *src++) ) 9 | ; 10 | 11 | return s; 12 | } 13 | -------------------------------------------------------------------------------- /source/libs/grid/string/strnlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DLLEXPORT __weak size_t strnlen(const char *s, size_t maxlen) 5 | { 6 | const char *es = s; 7 | while (*es && maxlen) { 8 | es++; 9 | maxlen--; 10 | } 11 | 12 | return (es - s); 13 | } 14 | -------------------------------------------------------------------------------- /source/libs/grid/string/strrchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | DLLEXPORT __weak char *strrchr(const char *s, int c) 6 | { 7 | const char *p = s + strlen(s); 8 | do { 9 | if (*p == (char)c) 10 | return (char *)p; 11 | } while (--p >= s); 12 | return NULL; 13 | } 14 | -------------------------------------------------------------------------------- /source/libs/grid/sys/Makefile: -------------------------------------------------------------------------------- 1 | DLL=yes 2 | include $(MY_BUILD_BASE)/config.mk 3 | 4 | LAST_INCLUDE += -I../include -I../../ 5 | PARTS = 6 | OBJS = vmalloc.o stdio.o file.o fb.o process.o 7 | 8 | all: subs_parts $(OBJS) 9 | $(LD) -r -o ../sys.o *.o $(ARCH_LD_FLAGS) 10 | 11 | 12 | include $(MY_BUILD_BASE)/cc.mk 13 | 14 | 15 | -------------------------------------------------------------------------------- /source/libs/grid/sys/file.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/grid/sys/file.c -------------------------------------------------------------------------------- /source/libs/grid/sys/vmalloc.c: -------------------------------------------------------------------------------- 1 | /** 2 | The Grid Core Library 3 | */ 4 | 5 | /** 6 | System level 7 | Yaosihai 8 | */ 9 | 10 | #include 11 | #include "sys/ke_req.h" 12 | 13 | void *sys_vmalloc(xstring name, void *addr, size_t len, int prot) 14 | { 15 | struct sysreq_memory_virtual_alloc req; 16 | 17 | req.base_address = (unsigned long)addr; 18 | req.mem_prot = prot; 19 | req.size = len; 20 | req.name = name; 21 | 22 | req.base.req_id = SYS_REQ_KERNEL_VIRTUAL_ALLOC; 23 | 24 | if (system_call(&req) == KE_INVALID_HANDLE) 25 | { 26 | return NULL; 27 | } 28 | 29 | return (void *)req.out_base; 30 | } -------------------------------------------------------------------------------- /source/libs/mk.shared: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/libs/mk.shared -------------------------------------------------------------------------------- /source/libs/pthread/Makefile: -------------------------------------------------------------------------------- 1 | DLL =yes 2 | 3 | include $(MY_BUILD_BASE)/config.mk 4 | 5 | TARGET = libpthread.so 6 | DEPENDS = -lhead_so.o -lgrid 7 | PARTS = 8 | OBJS = pthread.o 9 | ADD_INCLUDE +=-I. -I../grid/include 10 | 11 | FROM_OTHER_LIB =$(MY_BUILD_BASE)/build/pthread_spin_*.o 12 | 13 | all: subs_parts $(OBJS) implement.h 14 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(FROM_OTHER_LIB) $(ARCH_LD_FLAGS) 15 | $(CP) $(TARGET) $(SYSTEM_DIR) 16 | 17 | include $(MY_BUILD_BASE)/cc.mk 18 | 19 | 20 | -------------------------------------------------------------------------------- /source/libs/pthread/pthread.c: -------------------------------------------------------------------------------- 1 | 2 | #include "spin.c" 3 | #include "create.c" 4 | #include "ihash.c" 5 | #include "pthread_key.c" 6 | #include "pthread_specific.c" 7 | #include "pthread_once.c" 8 | 9 | void dll_main(int x, int y) 10 | { 11 | pthread_locks_init(); 12 | } -------------------------------------------------------------------------------- /source/libs/pthread/pthread_spin_destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_spin_destroy.c 3 | * 4 | * Description: 5 | * This translation unit implements spin lock primitives. 6 | */ 7 | 8 | #include "pthread.h" 9 | #include "implement.h" 10 | 11 | 12 | int pthread_spin_destroy (pthread_spinlock_t * lock) 13 | { 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /source/libs/pthread/readme.txt: -------------------------------------------------------------------------------- 1 | spin_lock/trylock/unlock use the version in grid.so, the in "build" dir. -------------------------------------------------------------------------------- /source/libs/pthread/spin.c: -------------------------------------------------------------------------------- 1 | #include "pthread_spin_destroy.c" 2 | 3 | -------------------------------------------------------------------------------- /source/programs/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/Makefile -------------------------------------------------------------------------------- /source/programs/baxi/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = main.o 7 | TARGET = baxi 8 | DEPENDS +=-lgrid.so -lhead_exe.o 9 | PARTS = cmd 10 | all: subs_parts $(OBJS) 11 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(ADD_LIBS) $(ARCH_LD_FLAGS) 12 | $(CP) $(TARGET) $(SYSTEM_DIR) 13 | 14 | include $(MY_BUILD_BASE)/cc.mk 15 | 16 | 17 | -------------------------------------------------------------------------------- /source/programs/baxi/cmd/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/Makefile -------------------------------------------------------------------------------- /source/programs/baxi/cmd/_null.c: -------------------------------------------------------------------------------- 1 | #include "cmd.h" 2 | 3 | static int _null(int argc, char * argv[]) 4 | { 5 | 6 | } 7 | 8 | struct cmd CMD_ENTRY cmd__null = { 9 | .name = 0, 10 | .desc = 0, 11 | .help = 0, 12 | .func = 0, 13 | }; 14 | -------------------------------------------------------------------------------- /source/programs/baxi/cmd/cat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/cat.c -------------------------------------------------------------------------------- /source/programs/baxi/cmd/cd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/cd.c -------------------------------------------------------------------------------- /source/programs/baxi/cmd/cmd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/cmd.c -------------------------------------------------------------------------------- /source/programs/baxi/cmd/cmd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/cmd.h -------------------------------------------------------------------------------- /source/programs/baxi/cmd/cp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/cp.c -------------------------------------------------------------------------------- /source/programs/baxi/cmd/help.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/help.c -------------------------------------------------------------------------------- /source/programs/baxi/cmd/ls.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/ls.c -------------------------------------------------------------------------------- /source/programs/baxi/cmd/rm.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/cmd/rm.c -------------------------------------------------------------------------------- /source/programs/baxi/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/baxi/main.c -------------------------------------------------------------------------------- /source/programs/dl/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = main.o libs.o 7 | TARGET = dl.sys 8 | LDFLAGS += --entry=dl_dynamic_linker -Ttext-segment=0x400000 9 | DEPENDS = $(SYSTEM_BUILD_TMP)/libs/$(ARCH_DIR)/elf.o $(SYSTEM_BUILD_TMP)/libs/$(ARCH_DIR)/common.o 10 | PARTS = 11 | ADD_INCLUDE += -I$(MY_BUILD_BASE)/source/libs/grid/include $(CL_INCLUDE) 12 | all: subs_parts $(OBJS) 13 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) $(OBJS) $(ARCH_LD_FLAGS) 14 | $(CP) $(TARGET) $(SYSTEM_DIR) 15 | 16 | include $(MY_BUILD_BASE)/cc.mk 17 | 18 | 19 | -------------------------------------------------------------------------------- /source/programs/dl/libs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/dl/libs.c -------------------------------------------------------------------------------- /source/programs/dl/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/dl/main.c -------------------------------------------------------------------------------- /source/programs/plant/Emulators/InfoNES/90.nes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/plant/Emulators/InfoNES/90.nes -------------------------------------------------------------------------------- /source/programs/plant/Emulators/InfoNES/InfoNES093J_Src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/plant/Emulators/InfoNES/InfoNES093J_Src.zip -------------------------------------------------------------------------------- /source/programs/plant/Emulators/InfoNES/InfoNES093J_Src/Makefile: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/config.mk 2 | 3 | all: 4 | rm -f *.o 5 | 6 | include $(MY_BUILD_BASE)/cc.mk 7 | 8 | -------------------------------------------------------------------------------- /source/programs/plant/Emulators/InfoNES/Makefile: -------------------------------------------------------------------------------- 1 | #Mips need ABICALLS for normal app with so linked 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | NES_SRC=InfoNES093J_Src 7 | 8 | OBJS = $(NES_SRC)/InfoNES.o $(NES_SRC)/InfoNES_Mapper.o $(NES_SRC)/InfoNES_pAPU.o $(NES_SRC)/K6502.o main.o 9 | TARGET = nes.exe 10 | DEPENDS +=-lgrid -lpthread -lhead_exe.o $(NES_SRC)/*.o 11 | ADD_INCLUDE +=-I$(NES_SRC) 12 | COMMON_CC_FLAGS +=-fno-exceptions 13 | PARTS = $(NES_SRC) 14 | all: subs_parts $(OBJS) 15 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(ARCH_LD_FLAGS) 16 | $(CP) $(TARGET) $(SYSTEM_DIR) 17 | $(CP) *.nes $(SYSTEM_DIR) 18 | 19 | #because make clean not work for NES_SRC 20 | rm -f $(NES_SRC)/*.o 21 | 22 | include $(MY_BUILD_BASE)/cc.mk 23 | -------------------------------------------------------------------------------- /source/programs/plant/Emulators/InfoNES/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/plant/Emulators/InfoNES/main.cpp -------------------------------------------------------------------------------- /source/programs/plant/Emulators/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/plant/Emulators/Makefile -------------------------------------------------------------------------------- /source/programs/plant/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/plant/Makefile -------------------------------------------------------------------------------- /source/programs/startup/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = main.o 7 | TARGET = startup 8 | DEPENDS +=-lgrid.so -lhead_exe.o 9 | 10 | all: subs_parts $(OBJS) 11 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) -Ttext-segment=0x800000 *.o $(ADD_LIBS) $(ARCH_LD_FLAGS) 12 | $(CP) $(TARGET) $(SYSTEM_DIR) 13 | 14 | include $(MY_BUILD_BASE)/cc.mk 15 | 16 | 17 | -------------------------------------------------------------------------------- /source/programs/startup/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/startup/main.c -------------------------------------------------------------------------------- /source/programs/test/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | PARTS = fnotify tcpip multipi 7 | 8 | all: subs_parts 9 | 10 | include $(MY_BUILD_BASE)/cc.mk 11 | 12 | 13 | -------------------------------------------------------------------------------- /source/programs/test/c++/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = test_new.o 7 | TARGET = test_new 8 | DEPENDS +=-lhead_exe.o -lgrdc++ -lpthread -lgrid 9 | ADD_INCLUDE += -I$(MY_BUILD_BASE)/include/c++/std \ 10 | -I$(MY_BUILD_BASE)/include/c++ $(STD_INCLUDE) 11 | my_c++flags += -c 12 | 13 | all: subs_parts $(OBJS) 14 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) *.o $(DEPENDS) $(ADD_LIBS) $(ARCH_LD_FLAGS) 15 | $(CP) $(TARGET) $(SYSTEM_DIR) 16 | 17 | include $(MY_BUILD_BASE)/cc.mk 18 | 19 | 20 | -------------------------------------------------------------------------------- /source/programs/test/fnotify/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = main.o 7 | TARGET = fnotify 8 | DEPENDS +=-lgrid -lhead_exe.o -lpthread 9 | 10 | all: subs_parts $(OBJS) 11 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(ADD_LIBS) $(ARCH_LD_FLAGS) 12 | $(CP) $(TARGET) $(SYSTEM_DIR) 13 | 14 | include $(MY_BUILD_BASE)/cc.mk 15 | 16 | 17 | -------------------------------------------------------------------------------- /source/programs/test/fnotify/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/test/fnotify/main.c -------------------------------------------------------------------------------- /source/programs/test/multipi/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = main.o 7 | TARGET = test-multipi 8 | DEPENDS +=-lgrid -lhead_exe.o -lpthread 9 | 10 | all: subs_parts $(OBJS) 11 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(ADD_LIBS) $(ARCH_LD_FLAGS) 12 | $(CP) $(TARGET) $(SYSTEM_DIR) 13 | 14 | include $(MY_BUILD_BASE)/cc.mk 15 | 16 | 17 | -------------------------------------------------------------------------------- /source/programs/test/multipi/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/test/multipi/main.c -------------------------------------------------------------------------------- /source/programs/test/pthread/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = main.o 7 | TARGET = test_pt 8 | DEPENDS += -lhead_exe.o -lpthread -lgrid 9 | ADD_INCLUDE += $(CL_INCLUDE) 10 | 11 | all: subs_parts $(OBJS) 12 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(ADD_LIBS) $(ARCH_LD_FLAGS) 13 | $(CP) $(TARGET) $(SYSTEM_DIR) 14 | 15 | include $(MY_BUILD_BASE)/cc.mk 16 | 17 | 18 | -------------------------------------------------------------------------------- /source/programs/test/tcpip/Makefile: -------------------------------------------------------------------------------- 1 | #Must use ABICALLS by setting NORMAL_APP, the ld.sys will call the dynamic entry with t9 as base on MIPS 2 | NORMAL_APP=yes 3 | 4 | include $(MY_BUILD_BASE)/config.mk 5 | 6 | OBJS = main.o 7 | TARGET = test-tcpip 8 | DEPENDS +=-lgrid -lpthread -lhead_exe.o 9 | ADD_INCLUDE += $(CL_INCLUDE) 10 | 11 | all: subs_parts $(OBJS) 12 | $(LD) $(LDFLAGS) -o $(TARGET) $(ADD_LDFLAGS) $(DEPENDS) *.o $(MY_BUILD_BASE)/source/libs/common/ring_buff.o $(ADD_LIBS) $(ARCH_LD_FLAGS) 13 | $(CP) $(TARGET) $(SYSTEM_DIR) 14 | 15 | include $(MY_BUILD_BASE)/cc.mk 16 | 17 | 18 | -------------------------------------------------------------------------------- /source/programs/test/tcpip/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/programs/test/tcpip/main.c -------------------------------------------------------------------------------- /source/subsystem/Makefile: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/config.mk 2 | 3 | OBJS = 4 | PARTS = fs session network 5 | 6 | all: subs_parts $(OBJS) 7 | 8 | 9 | include $(MY_BUILD_BASE)/cc.mk 10 | -------------------------------------------------------------------------------- /source/subsystem/fs/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/Makefile -------------------------------------------------------------------------------- /source/subsystem/fs/block.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/block.c -------------------------------------------------------------------------------- /source/subsystem/fs/fsnotify.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/fsnotify.c -------------------------------------------------------------------------------- /source/subsystem/fs/include/cache.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/include/cache.h -------------------------------------------------------------------------------- /source/subsystem/fs/include/fsnotify.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/include/fsnotify.h -------------------------------------------------------------------------------- /source/subsystem/fs/include/fss.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/include/fss.h -------------------------------------------------------------------------------- /source/subsystem/fs/include/node.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/include/node.h -------------------------------------------------------------------------------- /source/subsystem/fs/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/main.c -------------------------------------------------------------------------------- /source/subsystem/fs/mltt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/mltt.c -------------------------------------------------------------------------------- /source/subsystem/fs/tree.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/fs/tree.c -------------------------------------------------------------------------------- /source/subsystem/network/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/Makefile -------------------------------------------------------------------------------- /source/subsystem/network/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/main.c -------------------------------------------------------------------------------- /source/subsystem/network/protocol/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/Makefile -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/Makefile -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/non_user/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/non_user/Makefile -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/non_user/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/non_user/main.c -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/user/Makefile -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/include/arch/bpstruct.h: -------------------------------------------------------------------------------- 1 | #pragma pack(push,1) 2 | -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/include/arch/epstruct.h: -------------------------------------------------------------------------------- 1 | #pragma pack(pop) 2 | -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/include/arch/hash.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/user/include/arch/hash.h -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/include/arch/lwipopts.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/user/include/arch/lwipopts.h -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | #ifndef PERF_H 2 | #define PERF_H 3 | 4 | #define PERF_START 5 | #define PERF_STOP(what) 6 | #endif -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/include/arch/sys_arch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/user/include/arch/sys_arch.h -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/user/main.c -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/src/Makefile: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/config.mk 2 | 3 | ADD_INCLUDE +=-I../include -I../include/arch -I../include/ipv4 4 | 5 | OBJS = etharp.o memp.o netif.o pbuf.o def.o tcp.o tcp_in.o tcp_out.o udp.o timers.o hash.o init.o stats.o 6 | PARTS = ipv4 7 | 8 | all: subs_parts $(OBJS) 9 | $(LD) -r -o ../src.o *.o $(ARCH_LD_FLAGS) 10 | 11 | include $(MY_BUILD_BASE)/cc.mk 12 | -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/src/hash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/user/src/hash.c -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/src/ipv4/Makefile: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/config.mk 2 | 3 | ADD_INCLUDE +=-I../../include -I../../include/ipv4 -I../../include/arch 4 | 5 | OBJS = ip.o ip_addr.o icmp.o inet_chksum.o ip_frag.o 6 | PARTS = 7 | 8 | all: subs_parts $(OBJS) 9 | $(LD) -r -o ../ipv4.o *.o $(ARCH_LD_FLAGS) 10 | include $(MY_BUILD_BASE)/cc.mk 11 | -------------------------------------------------------------------------------- /source/subsystem/network/protocol/ip/user/utils.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/network/protocol/ip/user/utils.c -------------------------------------------------------------------------------- /source/subsystem/session/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/session/Makefile -------------------------------------------------------------------------------- /source/subsystem/session/ifi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/session/ifi.c -------------------------------------------------------------------------------- /source/subsystem/session/kb_unicode.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/session/kb_unicode.c -------------------------------------------------------------------------------- /source/subsystem/session/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/session/main.c -------------------------------------------------------------------------------- /source/subsystem/session/session.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/subsystem/session/session.h -------------------------------------------------------------------------------- /source/vc/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridnow/GridOS/74c036a2ba066f53a9ea31648e0bee4cbb0e4eb8/source/vc/readme.txt -------------------------------------------------------------------------------- /test/mac.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d /Volumes/TEST ]; then 2 | echo "Your TEST volume not mounted." 3 | exit 1 4 | fi 5 | cp -r ../release/ /Volumes/TEST/ 6 | qemu-system-i386 -L Bios -m 256 -serial file:a.txt -smp 4 -boot c -usb -drive id=disk,file=hd0.img,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 -localtime -soundhw es1370 -net nic,model=rtl8139 -net user 7 | -------------------------------------------------------------------------------- /tools/kpck/Makefile: -------------------------------------------------------------------------------- 1 | include $(MY_BUILD_BASE)/config.mk 2 | 3 | 4 | OBJS = pack.o 5 | TARGET = bsp.bin 6 | 7 | PARTS = 8 | 9 | all: update_exp.sys subs_parts $(OBJS) 10 | $(LD) $(OBJS) $(ARCH_LD_FLAGS) -Ttext-segment 0 --section-start .MIPS.options=0x10000000 --section-start .data=0 -o $(TARGET) 11 | $(OBJCOPY) -S -O binary -j .data $(TARGET) $(TARGET) 12 | $(CP) $(TARGET) $(SYSTEM_DIR) 13 | rm *.o 14 | 15 | update_exp.sys: 16 | $(OBJCOPY) -S linux.drv linux.drv 17 | touch hal.exp.sys 18 | #$(CP) $(SYSTEM_DIR)/hal.exp.sys . 19 | 20 | include $(MY_BUILD_BASE)/cc.mk 21 | 22 | 23 | --------------------------------------------------------------------------------