diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-17 10:25:35 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-17 10:25:35 +0200 |
commit | 5bc8549a8d7f5c9644f878fe3ca55761663a2fd0 (patch) | |
tree | 93613f66d792af3ab5d0e516ff17eb2daf3c4575 | |
parent | b6924d994ccdbe86ea67351d3c94600e14f5ed1f (diff) | |
download | TCE-5bc8549a8d7f5c9644f878fe3ca55761663a2fd0.tar.gz TCE-5bc8549a8d7f5c9644f878fe3ca55761663a2fd0.zip |
Now booting on CD-ROM.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 32 | ||||
-rw-r--r-- | bochs.cfg | 28 | ||||
-rwxr-xr-x | copy_fdd.sh | 14 | ||||
-rw-r--r-- | menu_cdrom.lst (renamed from menu_fdd.cfg) | 2 | ||||
-rw-r--r-- | src/kernel/mem/paging.cpp | 1 |
6 files changed, 41 insertions, 38 deletions
@@ -2,5 +2,7 @@ *.swp *.map *.elf +cdrom/* tmp TCE.fl.img +TCE.iso @@ -6,7 +6,7 @@ QemuCmd = qemu-system-i386 BasePath = $(shell pwd) SrcPath = $(BasePath)/src -Floppy = TCE.fl.img +Cdrom = TCE.iso all: @for p in $(Projects); do \ @@ -36,20 +36,24 @@ commit: mrproper git commit -a; exit 0 git push origin -floppy: - mkdir mnt; exit 0 - sudo mount $(Floppy) mnt -o loop - sudo ./copy_fdd.sh - sleep 0.3 - sudo umount mnt - - -bochs: all floppy +$(Cdrom): menu_cdrom.lst src/kernel/kernel.elf src/user/test/test.elf + mkdir -p cdrom/boot/grub + if [ ! -e cdrom/boot/grub/stage2_eltorito ]; then \ + echo "Please copy grub's stage2_eltorito to cdrom/boot/grub."; \ + exit -1; \ + fi + cp menu_cdrom.lst cdrom/boot/grub/menu.lst + cp src/kernel/kernel.elf cdrom + cp src/user/test/test.elf cdrom + genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 \ + -boot-info-table -input-charset ascii -A TCE -o $(Cdrom) cdrom + +bochs: all $(Cdrom) bochs -f bochs.cfg -qemu: all floppy - $(QemuCmd) -fda $(Floppy) -m 32 +qemu: all $(Cdrom) + $(QemuCmd) -cdrom $(Cdrom) -m 32 -qemu-gdb: all floppy - $(QemuCmd) -fda $(Floppy) -m 32 -s -S & gdb src/kernel/kernel.elf -x gdb-cmd +qemu-gdb: all $(Cdrom) + $(QemuCmd) -cdrom $(Cdrom) -m 32 -s -S & gdb src/kernel/kernel.elf -x gdb-cmd @@ -1,14 +1,16 @@ # configuration file generated by Bochs +plugin_ctrl: unmapped=1, biosdev=1, speaker=1, extfpuirq=1 config_interface: textconfig display_library: x -megs: 16 +memory: host=16, guest=16 romimage: file="/usr/share/bochs/BIOS-bochs-latest" vgaromimage: file="/usr/share/bochs/VGABIOS-lgpl-latest" -boot: floppy +boot: cdrom floppy_bootsig_check: disabled=0 -floppya: 1_44="TCE.fl.img", status=inserted +#floppya: type=1_44, 1_44="none", status=inserted, write_protected=0 # no floppyb ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +ata0-master: type=cdrom, path="TCE.iso", status=inserted, biosdetect=auto, model="Generic 1234" ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 ata2: enabled=0 ata3: enabled=0 @@ -18,20 +20,28 @@ com1: enabled=1, mode=null, dev="" com2: enabled=0 com3: enabled=0 com4: enabled=0 -i440fxsupport: enabled=0 -vga_update_interval: 40000 -vga: extension=vbe -cpu: count=1, ips=2000000, reset_on_triple_fault=1 +usb_uhci: enabled=0 +usb_ohci: enabled=0 +usb_xhci: enabled=0 +pci: enabled=0 +vga: extension=vbe, update_freq=25 +cpu: count=1, ips=2000000, model=bx_generic, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1 +cpuid: family=6, model=0x03, stepping=3, mmx=1, apic=xapic, sse=sse2, sse4a=0, sep=1, aes=0, xsave=0, xsaveopt=0, movbe=0, smep=0, mwait=1, mwait_is_nop=0 +cpuid: vendor_string="AuthenticAMD" +cpuid: brand_string="AMD Athlon(tm) processor" + +print_timestamps: enabled=0 +port_e9_hack: enabled=0 private_colormap: enabled=0 clock: sync=none, time0=local # no cmosimage ne2k: enabled=0 pnic: enabled=0 sb16: enabled=0 +es1370: enabled=0 # no loader log: - logprefix: %t%e%d -debugger_log: - panic: action=ask error: action=report info: action=report @@ -41,4 +51,4 @@ keyboard_serial_delay: 250 keyboard_paste_delay: 100000 keyboard_mapping: enabled=1, map=/usr/share/bochs/keymaps/x11-pc-fr.map user_shortcut: keys=none -mouse: enabled=0, type=ps2 +mouse: enabled=0, type=ps2, toggle=ctrl+mbutton diff --git a/copy_fdd.sh b/copy_fdd.sh deleted file mode 100755 index ebd53c5..0000000 --- a/copy_fdd.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# We assume mnt/ is the directory where the image is mounted, and src/ is the directory with all the compiled files -rm mnt/* - -# Update GRUB's menu.cfg -cp menu_fdd.cfg mnt/boot/menu.cfg - -# copy kernel -cp src/kernel/kernel.elf mnt -cp src/user/test/test.elf mnt - -#echo "*** Launching a BASH shell, if you want to do any maintenance ***" -#bash || exit 0 diff --git a/menu_fdd.cfg b/menu_cdrom.lst index 2be8686..4bbe812 100644 --- a/menu_fdd.cfg +++ b/menu_cdrom.lst @@ -1,4 +1,4 @@ -timeout 1 +timeout 10 title T/CE kernel /kernel.elf diff --git a/src/kernel/mem/paging.cpp b/src/kernel/mem/paging.cpp index 496b70c..8beee16 100644 --- a/src/kernel/mem/paging.cpp +++ b/src/kernel/mem/paging.cpp @@ -39,6 +39,7 @@ void paging_init(size_t totalRam) { frames.size = totalRam / 0x1000; frames.bits = (uint32_t*)ksbrk(INDEX_FROM_BIT(frames.size)); + memset(frames.bits, 0, INDEX_FROM_BIT(frames.size)); kernel_pagedir = (page_directory*)ksbrk(sizeof(page_directory)); kernel_pagedir->mappedSegs = 0; |