Skip to content

Instantly share code, notes, and snippets.

@nonakap
Created November 11, 2012 11:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nonakap/4054631 to your computer and use it in GitHub Desktop.
Save nonakap/4054631 to your computer and use it in GitHub Desktop.
2003年頃にNetBSD/pc98をどうにかしようと思っていた頃のarch/i386分離案らしい…
i386 分離
とりあえず IBM PC/AT 互換機依存部分は arch/pcat に移動させる。
pc98 依存部分は arch/pc98 に突っ込む。
FM-R と FM-TOWNS は arch/fm かなぁ。
--
i386/acpi -> pcat/acpi
i386/bios -> pcat/bios
i386/bioscall -> pcat/bioscall
i386/compile 削除
i386/conf
kernel config -> pcat/conf
files.i386 MACHINE 非依存を残す
・残す物
defflag opt_cputype.h
defflag VM86
defflag KVM86
defflag MATH_EMULATE
defflag USER_LDT
defflag MTRR
defflag LARGEPAGES
file db_*
file gdt.c
file in_cksum.S
file kdbg_machdep.c
file math_emulate.c
file mem.c
file tsc_microtime.c
file mtrr_i686.c
file mtrr_k6.c
file ns_cksum.c
file pmap.c (isa.h とかを include している)
file process_machdep.c
file softintr.c
file sys_machdep.c
file syscall.c
file trap.c (isa.h とかを include している)
file vm_machdep.c
file mptramp.S (MP 関連はどうする?)
file lock_machdep.c
file ipifuncs.c
file pmc.c
file des_enc.S
file des_cbc.S
file bf_enc.S
file bf_cbc.S
file vm86.c
file kvm86.c
file kvm86call.S
compat 関連全て
・MACHINE 依存・非依存部分を分離する物
file machdep.c -> i386_machdep.c
・要・不要が判らない物
defflag NOREDZONE (どこで使っているか知らない)
defflag opt_kstack_dr0.h (どこで使っているか知らない)
・残したいけれど駄目っぽい物
file cpu.c (MP もある。"ifdef pcat" すれば大丈夫?)
kern.ldscript* そのまま
largepage.inc $MACHINE/conf に移さないと駄目?
major.i386 削除
Makefile.i386 削除 (i386 generic な Makefile にする?)
std.i386 削除
i386/eisa -> pcat/eisa
i386/gdbscript そのまま
i386/i386
・残す物
compat_13_machdep.c
darwin*
db_*
freebsd*
gdt.c
ibcs2*
in_cksum.S
ipifuncs.c
kgdb_machdep.c
kvm86*
linux*
lock_machdep.c
mach_*
macho_machdep.c
math_emu*
mem.c
mptramp.S (MP 関連はどうする?)
mtrr*
pmap.c (少々変更有)
pmc.c
process_machdep.c
softintr.c
spl.S
svr4*
sys_machdep.c
syscall.c
trap.c (少々変更有)
tsc_microtime.c
vm_machdep.c
vm86.c
・残したいけれど駄目っぽい物
cpu.c
genassym.cf
vector.S (MACHINE_ARCH=i386 は i8259 を使う前提があれば…)
(共通部分を括り出して vector_subr.S を作る?)
・MACHINE 依存・非依存部分を分離する物
bus_machdep.c -> bus_dma.c (bus_dma(9) 関連は i386 generic っぽい)
locore.S -> locore_subr.S
machdep.c -> i386_machdep.c
i386/include
・残す物
ansi.h
aout_machdep.h
asm.h
atomic.h
bswap.h
byte_swap.h
cdefs.h
coff_machdep.h
cpufunc.h
cputypes.h (少々変更有)
cpuvar.h
darwin_machdep.h
db_machdep.h
elf_machdep.h
endian.h
endian_machdep.h
float.h
frame.h
frameasm.h
freebsd_machdep.h
gdt.h
ibcs2_machdep.h
ieee.h
ieeefp.h
int_*
ipkdb.h
kcore.h
kvm86.h
limits.h
loadfile_machdep.h
lock.h
macho_machdep.h
math.h
mcontext.h
mtrr.h
npx.h
param.h (MACHINE の定義だけは $MACHINE/include/param.h で行う)
pcb.h
pio.h
pmap.h
pmc.h
proc.h
profile.h
psl.h
pte.h
ptrace.h
reg.h
rnd.h
segments.h
setjmp.h
signal.h
specialreg.h
stdarg.h
svr4_machdep.h
sysarch.h
tlog.h
trap.h
tss.h
types.h
userret.h
vatargs.h
vm86.h
vmparam.h
・MACHINE 依存・非依存部分を分離する物
bus.h -> bus_dma.h (bus_dma(9) だけを括り出す)
・良く判らない物
bioscall.h (汎用的に使えそうな気がする)
cpu.h (CTL_MACHDEP と struct disklist はどうすればいいんだ…)
i82093* (ioapic。MP 関連で大量に include されている)
i82489* (lapic。MP 関連で大量に include されている)
intr.h (i8259 とか apic 関連を分離する?)
intrdefs.h (NUM_LEGACY_IRQS をどうする?)
i386/isa -> pcat/isa
i386/mca -> pcat/mca
i386/pci -> pcat/pci
i386/pnpbios -> pcat/pnpbios
i386/stand -> pcat/stand
--
pc98 マージ
--
files.* より
+--------+---------+
| ISA | C bus |
+--------+---------+
| isabus | neccbus |
| isa | cbus |
+--------+---------+
neccbus という名称は変更した方が良い気がする
--
現在の NetBSD には無い API
bus_space_map_load()
bus_space_map_prefer()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment