From d98828d08eb1f6c1394f38a1df69c73fef0cfefa Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Sun, 17 May 2015 19:43:59 +0200 Subject: working on vt52 and some cleanup --- Makefile | 10 +- bochs/bochsdebug | 2 - bochs/bochsrc | 965 ------------------------------------- font/Makefile | 5 - font/binarize.py | 87 ---- font/binfont.src | 1235 ------------------------------------------------ fs/file.c | 2 + fs/file.h | 14 + kernel/config.h | 2 +- kernel/console.c | 60 --- kernel/console.h | 19 - kernel/interrupts.c | 1 - kernel/kernel.c | 23 +- kernel/keyboard.c | 1 - kernel/syscalls.c | 5 +- kernel/task.c | 1 - lib/logger/log.c | 3 +- terminal/vt52.c | 120 ++++- terminal/vt52.h | 12 +- userspace/Makefile | 2 +- userspace/foolshell.c | 8 + video/console.c | 41 +- video/console.h | 13 +- xxx/bochs/bochsdebug | 2 + xxx/bochs/bochsrc | 965 +++++++++++++++++++++++++++++++++++++ xxx/font/Makefile | 5 + xxx/font/binarize.py | 87 ++++ xxx/font/binfont.src | 1235 ++++++++++++++++++++++++++++++++++++++++++++++++ xxx/inactive/console.c | 59 +++ xxx/inactive/console.h | 20 + 30 files changed, 2566 insertions(+), 2438 deletions(-) delete mode 100644 bochs/bochsdebug delete mode 100644 bochs/bochsrc delete mode 100644 font/Makefile delete mode 100644 font/binarize.py delete mode 100644 font/binfont.src create mode 100644 fs/file.c create mode 100644 fs/file.h delete mode 100644 kernel/console.c delete mode 100644 kernel/console.h create mode 100644 xxx/bochs/bochsdebug create mode 100644 xxx/bochs/bochsrc create mode 100644 xxx/font/Makefile create mode 100644 xxx/font/binarize.py create mode 100644 xxx/font/binfont.src create mode 100644 xxx/inactive/console.c create mode 100644 xxx/inactive/console.h diff --git a/Makefile b/Makefile index 50083b4..11a8d66 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,4 @@ - - - ##################### # # # FoolOS Build Sys. # @@ -19,7 +16,7 @@ FOOLOS=FoolOS.img FOOLOS_VDI=FoolOS.vdi #submodules -SUBDIRS=font userspace +SUBDIRS=userspace #take care to set this properly! USB_STICK=/dev/sdf @@ -31,11 +28,11 @@ AS=i686-foolos-as ############ compiler flags ############ CFLAGS= ## CFLAGS+=-fstack-protector-all -## CFLAGS+=-Werror-implicit-function-declaration +CFLAGS+=-Wno-implicit-function-declaration ## CFLAGS+=-w CFLAGS+=-ffreestanding #CFLATS+=-Wall -CFLAGS+=-Wextra +#CFLAGS+=-Wextra #CFLAGS+=-O3 #CFLAGS+=-O0 #CFLAGS+=-nostdlib @@ -48,6 +45,7 @@ CFLAGS+=-gstabs #CFLAGS+= -O4 #CFLAGS+=-fdata-sections -ffunction-sections #CFLAGS+= -Werror +CFLAGS+= -w LDFLAGS= LDFLAGS+=-nostdlib diff --git a/bochs/bochsdebug b/bochs/bochsdebug deleted file mode 100644 index fabafe9..0000000 --- a/bochs/bochsdebug +++ /dev/null @@ -1,2 +0,0 @@ -continue - diff --git a/bochs/bochsrc b/bochs/bochsrc deleted file mode 100644 index 47a7d3f..0000000 --- a/bochs/bochsrc +++ /dev/null @@ -1,965 +0,0 @@ -# -# -# -## You may now use double quotes around pathnames, in case -# your pathname includes spaces. - -#======================================================================= -# CONFIG_INTERFACE -# -# The configuration interface is a series of menus or dialog boxes that -# allows you to change all the settings that control Bochs's behavior. -# Depending on the platform there are up to 3 choices of configuration -# interface: a text mode version called "textconfig" and two graphical versions -# called "win32config" and "wx". The text mode version uses stdin/stdout and -# is always compiled in, unless Bochs is compiled for wx only. The choice -# "win32config" is only available on win32 and it is the default there. -# The choice "wx" is only available when you use "--with-wx" on the configure -# command. If you do not write a config_interface line, Bochs will -# choose a default for you. -# -# NOTE: if you use the "wx" configuration interface, you must also use -# the "wx" display library. -#======================================================================= -#config_interface: textconfig -#config_interface: wx - -#======================================================================= -# DISPLAY_LIBRARY -# -# The display library is the code that displays the Bochs VGA screen. Bochs -# has a selection of about 10 different display library implementations for -# different platforms. If you run configure with multiple --with-* options, -# the display_library command lets you choose which one you want to run with. -# If you do not write a display_library line, Bochs will choose a default for -# you. -# -# The choices are: -# x use X windows interface, cross platform -# sdl use SDL library, cross platform -# svga use SVGALIB library for Linux, allows graphics without X11 -# term text only, uses curses/ncurses library, cross platform -# rfb provides an interface to AT&T's VNC viewer, cross platform -# wx use wxWidgets library, cross platform -# nogui no display at all -# -# NOTE: if you use the "wx" configuration interface, you must also use -# the "wx" display library. -# -# Specific options: -# Some display libraries now support specific option to control their -# behaviour. See the examples below for currently supported options. -#======================================================================= -#display_library: rfb, options="timeout=60" # time to wait for client -#display_library: sdl #, options="fullscreen" # startup in fullscreen mode -#display_library: term -#display_library: wx -#display_library: x, options="hideIPS" # disable IPS output in status bar -display_library: x, options="gui_debug" # use GTK debugger gui -#display_library: term -#display_library: x -# - -#======================================================================= -# ROMIMAGE: -# The ROM BIOS controls what the PC does when it first powers on. -# Normally, you can use a precompiled BIOS in the source or binary -# distribution called BIOS-bochs-latest. The ROM BIOS is usually loaded -# starting at address 0xf0000, and it is exactly 64k long. Another option -# is 128k BIOS which is loaded at address 0xe0000. -# You can also use the environment variable $BXSHARE to specify the -# location of the BIOS. -# The usage of external large BIOS images (up to 512k) at memory top is -# now supported, but we still recommend to use the BIOS distributed with -# Bochs. The start address optional, since it can be calculated from image size. -#======================================================================= -#romimage: file=/usr/share/bochs/BIOS-bochs-latest -#romimage: file=bios/seabios-0.5.1.bin -#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top -#romimage: file=/home/miguel/opt/bochs-2.6.6/bios/BIOS-bochs-latest - - -#======================================================================= -# CPU: -# This defines cpu-related parameters inside Bochs: -# -# COUNT: -# Set the number of processors:cores per processor:threads per core -# when Bochs is compiled for SMP emulation. -# Bochs currently supports up to 8 threads running simultaniosly. -# If Bochs is compiled without SMP support, it won't accept values -# different from 1. -# -# QUANTUM: -# Maximum amount of instructions allowed to execute by processor before -# returning control to another cpu. This option exists only in Bochs -# binary compiled with SMP support. -# -# RESET_ON_TRIPLE_FAULT: -# Reset the CPU when triple fault occur (highly recommended) rather than -# PANIC. Remember that if you trying to continue after triple fault the -# simulation will be completely bogus ! -# -# MSRS: -# Define path to user CPU Model Specific Registers (MSRs) specification. -# See example in msrs.def. -# -# IGNORE_BAD_MSRS: -# Ignore MSR references that Bochs does not understand; print a warning -# message instead of generating #GP exception. This option is enabled -# by default but will not be avaiable if configurable MSRs are enabled. -# -# IPS: -# Emulated Instructions Per Second. This is the number of IPS that bochs -# is capable of running on your machine. You can recompile Bochs with -# --enable-show-ips option enabled, to find your host's capability. -# Measured IPS value will then be logged into your log file or shown -# in the status bar (if supported by the gui). -# -# IPS is used to calibrate many time-dependent events within the bochs -# simulation. For example, changing IPS affects the frequency of VGA -# updates, the duration of time before a key starts to autorepeat, and -# the measurement of BogoMips and other benchmarks. -# -# Examples: -# -# Bochs Machine/Compiler Mips -# ____________________________________________________________________ -# 2.3.7 3.2Ghz Intel Core 2 Q9770 with WinXP/g++ 3.4 50 to 55 Mips -# 2.3.7 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 38 to 43 Mips -# 2.2.6 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 21 to 25 Mips -# 2.2.6 2.1Ghz Athlon XP with Linux 2.6/g++ 3.4 12 to 15 Mips -# 2.0.1 1.6Ghz Intel P4 with Win2000/g++ 3.3 5 to 7 Mips -#======================================================================= -cpu: count=2 #, ips=1000000 #, reset_on_triple_fault=1, ignore_bad_msrs=1, msrs="msrs.def" - -#======================================================================= -# CPUID: -# -# This defines features and functionality supported by Bochs emulated CPU: -# -# MMX: -# Select MMX instruction set support. -# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 5. -# -# SEP: -# Select SYSENTER/SYSEXIT instruction set support. -# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. -# -# SSE: -# Select SSE instruction set support. -# Any of NONE/SSE/SSE2/SSE3/SSSE3/SSE4_1/SSE4_2 could be selected. -# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. -# -# XAPIC: -# Select XAPIC extensions support. -# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. -# -# AES: -# Select AES instruction set support. -# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. -# -# MOVBE: -# Select MOVBE Intel(R) Atom instruction support. -# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. -# -# XSAVE: -# Select XSAVE extensions support. -# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. -# -# 1G_PAGES: -# Enable 1G page size support in long mode. -# This option exists only if Bochs compiled with x86-64 support. -# -# PCID: -# Enable Process-Context Identifiers (PCID) support in long mode. -# This option exists only if Bochs compiled with x86-64 support. -# -# FSGSBASE: -# Enable GS/GS BASE access instructions support in long mode. -# This option exists only if Bochs compiled with x86-64 support. -# -# MWAIT: -# Select MONITOR/MWAIT instructions support. -# This option exists only if Bochs compiled with --enable-monitor-mwait. -# -# MWAIT_IS_NOP: -# When this option is enabled MWAIT will not put the CPU into a sleep state. -# This option exists only if Bochs compiled with --enable-monitor-mwait. -# -# VENDOR_STRING: -# Set the CPUID vendor string returned by CPUID(0x0). This should be a -# twelve-character ASCII string. -# -# BRAND_STRING: -# Set the CPUID vendor string returned by CPUID(0x80000002 .. 0x80000004). -# This should be at most a forty-eight-character ASCII string. -# -# STEPPING: -# Set stepping information returned by CPUID. Default stepping value is 3. -# -# CPUID_LIMIT_WINNT: -# Determine whether to limit maximum CPUID function to 3. This mode is -# required to workaround WinNT installation and boot issues. -#======================================================================= -#cpuid: mmx=1, sep=1, sse=sse4_2, xapic=1, aes=1, movbe=1, xsave=1 -#cpuid: stepping=5 -#cpuid: cpuid_limit_winnt=0 -#cpuid: mmx=1, sep=1, sse=sse4_2, xapic=1, aes=1, movbe=1, xsave=1 - -#======================================================================= -# MEMORY -# Set the amount of physical memory you want to emulate. -# -# GUEST: -# Set amount of guest physical memory to emulate. The default is 32MB, -# the maximum amount limited only by physical address space limitations. -# -# HOST: -# Set amount of host memory you want to allocate for guest RAM emulation. -# It is possible to allocate less memory than you want to emulate in guest -# system. This will fake guest to see the non-existing memory. Once guest -# system touches new memory block it will be dynamically taken from the -# memory pool. You will be warned (by FATAL PANIC) in case guest already -# used all allocated host memory and wants more. -# -#======================================================================= -memory: guest=128, host=1024 - -#======================================================================= -# OPTROMIMAGE[1-4]: -# You may now load up to 4 optional ROM images. Be sure to use a -# read-only area, typically between C8000 and EFFFF. These optional -# ROM images should not overwrite the rombios (located at -# F0000-FFFFF) and the videobios (located at C0000-C7FFF). -# Those ROM images will be initialized by the bios if they contain -# the right signature (0x55AA) and a valid checksum. -# It can also be a convenient way to upload some arbitrary code/data -# in the simulation, that can be retrieved by the boot loader -#======================================================================= -#optromimage1: file=optionalrom.bin, address=0xd0000 -#optromimage2: file=optionalrom.bin, address=0xd1000 -#optromimage3: file=optionalrom.bin, address=0xd2000 -#optromimage4: file=optionalrom.bin, address=0xd3000 - -#optramimage1: file=FoolData.img, address=0x90000 -#optramimage2: file=/path/file2.img, address=0x0020000 -#optramimage3: file=/path/file3.img, address=0x0030000 -#optramimage4: file=/path/file4.img, address=0x0040000 - -#======================================================================= -# VGAROMIMAGE -# You now need to load a VGA ROM BIOS into C0000. -#======================================================================= -#vgaromimage: file=/usr/share/vgabios/vgabios.bin -#vgaromimage: file=/usr/share/vgabios/vgabios.qxl.bin -#vgaromimage: file=/home/miguel/temp/vgabios-0.7a.bin -#vgaromimage: file=/home/miguel/temp/vgabios-0.7a.cirrus.bin -# -#vgaromimage: file=/usr/share/vgabios/vgabios.qxl.bin -#vgaromimage: file=/usr/share/vgabios/vgabios.debug.bin -#vgaromimage: file=/usr/share/vgabios/vgabios.cirrus.bin -#vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest -#vgaromimage: file=/home/miguel/opt/bochs-2.6.6/bios/VGABIOS-lgpl-latest-cirrus - -#======================================================================= -# VGA: -# Here you can specify the display extension to be used. With the value -# 'none' you can use standard VGA with no extension. Other supported -# values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support. -#======================================================================= -#vga: extension=vbe -#vga: extension=cirrus - -#======================================================================= -# FLOPPYA: -# Point this to pathname of floppy image file or device -# This should be of a bootable floppy(image/device) if you're -# booting from 'a' (or 'floppy'). -# -# You can set the initial status of the media to 'ejected' or 'inserted'. -# floppya: 2_88=path, status=ejected (2.88M 3.5" media) -# floppya: 1_44=path, status=inserted (1.44M 3.5" media) -# floppya: 1_2=path, status=ejected (1.2M 5.25" media) -# floppya: 720k=path, status=inserted (720K 3.5" media) -# floppya: 360k=path, status=inserted (360K 5.25" media) -# floppya: 320k=path, status=inserted (320K 5.25" media) -# floppya: 180k=path, status=inserted (180K 5.25" media) -# floppya: 160k=path, status=inserted (160K 5.25" media) -# floppya: image=path, status=inserted (guess media type from image size) -# floppya: 1_44=vvfat:path, status=inserted (use directory as VFAT media) -# floppya: type=1_44 (1.44M 3.5" floppy drive, no media) -# -# The path should be the name of a disk image file. On Unix, you can use a raw -# device name such as /dev/fd0 on Linux. On win32 platforms, use drive letters -# such as a: or b: as the path. The parameter 'image' works with image files -# only. In that case the size must match one of the supported types. -# The parameter 'type' can be used to enable the floppy drive without media -# and status specified. Usually the drive type is set up based on the media type. -# The optional parameter 'write_protected' can be used to control the media -# write protect switch. By default it is turned off. -#======================================================================= -#floppya: 1_44=FoolOS.img, status=inserted -#floppya: image=../1.44, status=inserted -#floppya: 1_44=/dev/fd0H1440, status=inserted -#floppya: 1_2=../1_2, status=inserted -#floppya: 1_44=a:, status=inserted -#floppya: 1_44=a.img, status=inserted, write_protected=1 -#floppya: 1_44=/dev/rfd0a, status=inserted - -#======================================================================= -# FLOPPYB: -# See FLOPPYA above for syntax -#======================================================================= -#floppyb: 1_44=b:, status=inserted -#floppyb: 1_44=b.img, status=inserted - -#======================================================================= -# ATA0, ATA1, ATA2, ATA3 -# ATA controller for hard disks and cdroms -# -# ata[0-3]: enabled=[0|1], ioaddr1=addr, ioaddr2=addr, irq=number -# -# These options enables up to 4 ata channels. For each channel -# the two base io addresses and the irq must be specified. -# -# ata0 and ata1 are enabled by default with the values shown below -# -# Examples: -# ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 -# ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 -# ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 -# ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9 -#======================================================================= -#ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 -#ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 -#ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 -#ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9 - -#======================================================================= -# ATA[0-3]-MASTER, ATA[0-3]-SLAVE -# -# This defines the type and characteristics of all attached ata devices: -# type= type of attached device [disk|cdrom] -# mode= only valid for disks [flat|concat|external|dll|sparse|vmware3] -# mode= only valid for disks [undoable|growing|volatile|vvfat] -# path= path of the image / directory -# cylinders= only valid for disks -# heads= only valid for disks -# spt= only valid for disks -# status= only valid for cdroms [inserted|ejected] -# biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos] -# translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto] -# model= string returned by identify device command -# journal= optional filename of the redolog for undoable, volatile and vvfat disks -# -# Point this at a hard disk image file, cdrom iso file, or physical cdrom -# device. To create a hard disk image, try running bximage. It will help you -# choose the size and then suggest a line that works with it. -# -# In UNIX it may be possible to use a raw device as a Bochs hard disk, -# but WE DON'T RECOMMEND IT. In Windows there is no easy way. -# -# In windows, the drive letter + colon notation should be used for cdroms. -# Depending on versions of windows and drivers, you may only be able to -# access the "first" cdrom in the system. On MacOSX, use path="drive" -# to access the physical drive. -# -# The path is mandatory for hard disks. Disk geometry autodetection works with -# images created by bximage if CHS is set to 0/0/0 (cylinders are calculated -# using heads=16 and spt=63). For other hard disk images and modes the -# cylinders, heads, and spt are mandatory. In all cases the disk size reported -# from the image must be exactly C*H*S*512. -# -# Default values are: -# mode=flat, biosdetect=auto, translation=auto, model="Generic 1234" -# -# The biosdetect option has currently no effect on the bios -# -# Examples: - ata0-master: type=disk, mode=flat, path=disk.img #, cylinders=10, heads=4, spt=18 -# ata0-master: type=disk, mode=flat, path=disk.img -# ata0-slave: type=disk, mode=flat, path=20M.sample, cylinders=615, heads=4, spt=17 -# ata1-master: type=disk, mode=flat, path=30M.sample, cylinders=615, heads=6, spt=17 -# ata1-slave: type=disk, mode=flat, path=46M.sample, cylinders=940, heads=6, spt=17 -# ata2-master: type=disk, mode=flat, path=62M.sample, cylinders=940, heads=8, spt=17 -# ata2-slave: type=disk, mode=flat, path=112M.sample, cylinders=900, heads=15, spt=17 -# ata3-master: type=disk, mode=flat, path=483M.sample, cylinders=1024, heads=15, spt=63 -# ata3-slave: type=cdrom, path=iso.sample, status=inserted -#======================================================================= -#ata0-master: type=disk, mode=flat, path="d.sample" -#ata0-master: type=disk, mode=flat, path="$HOME/.bochs/guest.hd0", cylinders=#cylinders#, heads=16, spt=63 -#ata0-master: type=disk, mode=flat, path="c.img", cylinders=0 # autodetect -#ata0-slave: type=disk, mode=vvfat, path=/bochs/images/vvfat, journal=vvfat.redolog -#ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted - -#======================================================================= -# BOOT: -# This defines the boot sequence. Now you can specify up to 3 boot drives, -# which can be 'floppy', 'disk', 'cdrom' or 'network' (boot ROM). -# Legacy 'a' and 'c' are also supported. -# Examples: -# boot: floppy -# boot: cdrom, disk -# boot: network, disk -# boot: cdrom, floppy, disk -#======================================================================= -#boot: floppy -boot: disk -#boot: floppy - -#======================================================================= -# CLOCK: -# This defines the parameters of the clock inside Bochs: -# -# SYNC: -# This defines the method how to synchronize the Bochs internal time -# with realtime. With the value 'none' the Bochs time relies on the IPS -# value and no host time synchronization is used. The 'slowdown' method -# sacrifices performance to preserve reproducibility while allowing host -# time correlation. The 'realtime' method sacrifices reproducibility to -# preserve performance and host-time correlation. -# It is possible to enable both synchronization methods. -# -# TIME0: -# Specifies the start (boot) time of the virtual machine. Use a time -# value as returned by the time(2) system call. If no time0 value is -# set or if time0 equal to 1 (special case) or if time0 equal 'local', -# the simulation will be started at the current local host time. -# If time0 equal to 2 (special case) or if time0 equal 'utc', -# the simulation will be started at the current utc time. -# -# Syntax: -# clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc] -# -# Example: -# clock: sync=none, time0=local # Now (localtime) -# clock: sync=slowdown, time0=315529200 # Tue Jan 1 00:00:00 1980 -# clock: sync=none, time0=631148400 # Mon Jan 1 00:00:00 1990 -# clock: sync=realtime, time0=938581955 # Wed Sep 29 07:12:35 1999 -# clock: sync=realtime, time0=946681200 # Sat Jan 1 00:00:00 2000 -# clock: sync=none, time0=1 # Now (localtime) -# clock: sync=none, time0=utc # Now (utc/gmt) -# -# Default value are sync=none, time0=local -#======================================================================= -#clock: sync=realtime, time0=local - - -#======================================================================= -# FLOPPY_BOOTSIG_CHECK: disabled=[0|1] -# Enables or disables the 0xaa55 signature check on boot floppies -# Defaults to disabled=0 -# Examples: -# floppy_bootsig_check: disabled=0 -# floppy_bootsig_check: disabled=1 -#======================================================================= -#floppy_bootsig_check: disabled=0 - -#======================================================================= -# LOG: -# Give the path of the log file you'd like Bochs debug and misc. verbiage -# to be written to. If you don't use this option or set the filename to -# '-' the output is written to the console. If you really don't want it, -# make it "/dev/null" (Unix) or "nul" (win32). :^( -# -# Examples: -# log: ./bochs.out -# log: /dev/tty -#======================================================================= -#log: /dev/stdout -#log: ./bochs.log - -#======================================================================= -# LOGPREFIX: -# This handles the format of the string prepended to each log line. -# You may use those special tokens : -# %t : 11 decimal digits timer tick -# %i : 8 hexadecimal digits of cpu current eip (ignored in SMP configuration) -# %e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror) -# %d : 5 characters string of the device, between brackets -# -# Default : %t%e%d -# Examples: -# logprefix: %t-%e-@%i-%d -# logprefix: %i%e%d -#======================================================================= -#logprefix: %t%e%d - -#======================================================================= -# LOG CONTROLS -# -# Bochs now has four severity levels for event logging. -# panic: cannot proceed. If you choose to continue after a panic, -# don't be surprised if you get strange behavior or crashes. -# error: something went wrong, but it is probably safe to continue the -# simulation. -# info: interesting or useful messages. -# debug: messages useful only when debugging the code. This may -# spit out thousands per second. -# -# For events of each level, you can choose to crash, report, or ignore. -# TODO: allow choice based on the facility: e.g. crash on panics from -# everything except the cdrom, and only report those. -# -# If you are experiencing many panics, it can be helpful to change -# the panic action to report instead of fatal. However, be aware -# that anything executed after a panic is uncharted territory and can -# cause bochs to become unstable. The panic is a "graceful exit," so -# if you disable it you may get a spectacular disaster instead. -#======================================================================= -#panic: action=ask -#error: action=report -#info: action=report -#debug: action=report -#debug: action=report -#pass: action=fatal - -#======================================================================= -# DEBUGGER_LOG: -# Give the path of the log file you'd like Bochs to log debugger output. -# If you really don't want it, make it /dev/null or '-'. :^( -# -# Examples: -# debugger_log: ./debugger.out -#======================================================================= -#debugger_log: /dev/null -#debugger_log: debugger.out -#debugger_log: - - -#======================================================================= -# COM1, COM2, COM3, COM4: -# This defines a serial port (UART type 16550A). In the 'term' you can specify -# a device to use as com1. This can be a real serial line, or a pty. To use -# a pty (under X/Unix), create two windows (xterms, usually). One of them will -# run bochs, and the other will act as com1. Find out the tty the com1 -# window using the `tty' command, and use that as the `dev' parameter. -# Then do `sleep 1000000' in the com1 window to keep the shell from -# messing with things, and run bochs in the other window. Serial I/O to -# com1 (port 0x3f8) will all go to the other window. -# In socket* and pipe* (win32 only) modes Bochs becomes either socket/named pipe -# client or server. In client mode it connects to an already running server (if -# connection fails Bochs treats com port as not connected). In server mode it -# opens socket/named pipe and waits until a client application connects to it -# before starting simulation. This mode is useful for remote debugging (e.g. -# with gdb's "target remote host:port" command or windbg's command line option -# -k com:pipe,port=\\.\pipe\pipename). Note: 'socket' is a shorthand for -# 'socket-client' and 'pipe' for 'pipe-client'. Socket modes use simple TCP -# communication, pipe modes use duplex byte mode pipes. -# Other serial modes are 'null' (no input/output), 'file' (output to a file -# specified as the 'dev' parameter), 'raw' (use the real serial port - under -# construction for win32), 'mouse' (standard serial mouse - requires -# mouse option setting 'type=serial', 'type=serial_wheel' or 'type=serial_msys'). -# -# Examples: -# com1: enabled=1, mode=null -# com1: enabled=1, mode=mouse -# com2: enabled=1, mode=file, dev=serial.out -# com3: enabled=1, mode=raw, dev=com1 -# com3: enabled=1, mode=socket-client, dev=localhost:8888 -# com3: enabled=1, mode=socket-server, dev=localhost:8888 -# com4: enabled=1, mode=pipe-client, dev=\\.\pipe\mypipe -# com4: enabled=1, mode=pipe-server, dev=\\.\pipe\mypipe -#======================================================================= -# com1: enabled=1, mode=term, dev=/dev/ttyS0 - - -#======================================================================= -# PARPORT1, PARPORT2: -# This defines a parallel (printer) port. When turned on and an output file is -# defined the emulated printer port sends characters printed by the guest OS -# into the output file. On some platforms a device filename can be used to -# send the data to the real parallel port (e.g. "/dev/lp0" on Linux, "lpt1" on -# win32 platforms). -# -# Examples: -# parport1: enabled=1, file="parport.out" -# parport2: enabled=1, file="/dev/lp0" -# parport1: enabled=0 -#======================================================================= -# parport1: enabled=1, file="/dev/lp0" - -#======================================================================= -# SB16: -# This defines the SB16 sound emulation. It can have several of the -# following properties. -# All properties are in the format sb16: property=value -# midi: The filename is where the midi data is sent. This can be a -# device or just a file if you want to record the midi data. -# midimode: -# 0=no data -# 1=output to device (system dependent. midi denotes the device driver) -# 2=SMF file output, including headers -# 3=output the midi data stream to the file (no midi headers and no -# delta times, just command and data bytes) -# wave: This is the device/file where wave output is stored -# wavemode: -# 0=no data -# 1=output to device (system dependent. wave denotes the device driver) -# 2=VOC file output, incl. headers -# 3=output the raw wave stream to the file -# log: The file to write the sb16 emulator messages to. -# loglevel: -# 0=no log -# 1=resource changes, midi program and bank changes -# 2=severe errors -# 3=all errors -# 4=all errors plus all port accesses -# 5=all errors and port accesses plus a lot of extra info -# dmatimer: -# microseconds per second for a DMA cycle. Make it smaller to fix -# non-continuous sound. 750000 is usually a good value. This needs a -# reasonably correct setting for the IPS parameter of the CPU option. -# -# Examples for output devices: -# sb16: midimode=1, midi="", wavemode=1, wave="" # win32 -# sb16: midimode=1, midi=alsa:128:0, wavemode=1, wave=alsa # Linux with ALSA -#======================================================================= -#sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=/dev/stdout, dmatimer=600000 - -#======================================================================= -# VGA_UPDATE_INTERVAL: -# Video memory is scanned for updates and screen updated every so many -# virtual seconds. The default is 50000, about 20Hz. Keep in mind that -# you must tweak the 'cpu: ips=N' directive to be as close to the number -# of emulated instructions-per-second your workstation can do, for this -# to be accurate. -# -# Examples: -# vga_update_interval: 250000 -#======================================================================= -#vga_update_interval: 300000 -#vga_update_interval: 40000 - -# using for Winstone '98 tests -#vga_update_interval: 100000 - -#======================================================================= -# KEYBOARD_SERIAL_DELAY: -# Approximate time in microseconds that it takes one character to -# be transfered from the keyboard to controller over the serial path. -# Examples: -# keyboard_serial_delay: 200 -#======================================================================= -#keyboard_serial_delay: 250 - -#======================================================================= -# KEYBOARD_PASTE_DELAY: -# Approximate time in microseconds between attempts to paste -# characters to the keyboard controller. This leaves time for the -# guest os to deal with the flow of characters. The ideal setting -# depends on how your operating system processes characters. The -# default of 100000 usec (.1 seconds) was chosen because it works -# consistently in Windows. -# -# If your OS is losing characters during a paste, increase the paste -# delay until it stops losing characters. -# -# Examples: -# keyboard_paste_delay: 100000 -#======================================================================= -#keyboard_paste_delay: 100000 - -#======================================================================= -# MOUSE: -# This defines parameters for the emulated mouse type, the initial status -# of the mouse capture and the runtime method to toggle it. -# -# TYPE: -# With the mouse type option you can select the type of mouse to emulate. -# The default value is 'ps2'. The other choices are 'imps2' (wheel mouse -# on PS/2), 'serial', 'serial_wheel' and 'serial_msys' (one com port requires -# setting 'mode=mouse'). To connect a mouse to an USB port, see the 'usb_uhci' -# or 'usb_ohci' option (requires PCI and USB support). -# -# ENABLED: -# The Bochs gui creates mouse "events" unless the 'enabled' option is -# set to 0. The hardware emulation itself is not disabled by this. -# Unless you have a particular reason for enabling the mouse by default, -# it is recommended that you leave it off. You can also toggle the mouse -# usage at runtime (RFB, SDL, Win32, wxWidgets and X11 - see below). -# -# TOGGLE: -# The default method to toggle the mouse capture at runtime is to press the -# CTRL key and the middle mouse button ('ctrl+mbutton'). This option allows -# to change the method to 'ctrl+f10' (like DOSBox), 'ctrl+alt' (like QEMU) -# or 'f12' (replaces win32 'legacyF12' option). -# -# Examples: -# mouse: enabled=1 -# mouse: type=imps2, enabled=1 -# mouse: type=serial, enabled=1 -# mouse: enabled=0, toggle=ctrl+f10 -#======================================================================= -#mouse: enabled=1 - -#======================================================================= -# private_colormap: Request that the GUI create and use it's own -# non-shared colormap. This colormap will be used -# when in the bochs window. If not enabled, a -# shared colormap scheme may be used. Not implemented -# on all GUI's. -# -# Examples: -# private_colormap: enabled=1 -# private_colormap: enabled=0 -#======================================================================= -#private_colormap: enabled=0 - -#======================================================================= -# ne2k: NE2000 compatible ethernet adapter -# -# Examples: -# ne2k: ioaddr=IOADDR, irq=IRQ, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT -# -# ioaddr, irq: You probably won't need to change ioaddr and irq, unless there -# are IRQ conflicts. These arguments are ignored when assign the ne2k to a -# PCI slot. -# -# mac: The MAC address MUST NOT match the address of any machine on the net. -# Also, the first byte must be an even number (bit 0 set means a multicast -# address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast -# address. For the ethertap module, you must use fe:fd:00:00:00:01. There may -# be other restrictions too. To be safe, just use the b0:c4... address. -# -# ethdev: The ethdev value is the name of the network interface on your host -# platform. On UNIX machines, you can get the name by running ifconfig. On -# Windows machines, you must run niclist to get the name of the ethdev. -# Niclist source code is in misc/niclist.c and it is included in Windows -# binary releases. -# -# script: The script value is optional, and is the name of a script that -# is executed after bochs initialize the network interface. You can use -# this script to configure this network interface, or enable masquerading. -# This is mainly useful for the tun/tap devices that only exist during -# Bochs execution. The network interface name is supplied to the script -# as first parameter -# -# If you don't want to make connections to any physical networks, -# you can use the following 'ethmod's to simulate a virtual network. -# null: All packets are discarded, but logged to a few files. -# arpback: ARP is simulated. Disabled by default. -# vde: Virtual Distributed Ethernet -# vnet: ARP, ICMP-echo(ping), DHCP and read/write TFTP are simulated. -# The virtual host uses 192.168.10.1. -# DHCP assigns 192.168.10.2 to the guest. -# TFTP uses the ethdev value for the root directory and doesn't -# overwrite files. -# -#======================================================================= -# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0 -# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0 -# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig -# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=null, ethdev=eth0 -# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl" -# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp" - -#======================================================================= -# pnic: Bochs/Etherboot pseudo-NIC -# -# Example: -# pnic: enabled=1, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT -# -# The pseudo-NIC accepts the same syntax (for mac, ethmod, ethdev, script) and -# supports the same networking modules as the NE2000 adapter. In addition to -# this, it must be assigned to a PCI slot. -#======================================================================= -#pnic: enabled=1, mac=b0:c4:20:00:00:00, ethmod=vnet - -#======================================================================= -# KEYBOARD_MAPPING: -# This enables a remap of a physical localized keyboard to a -# virtualized us keyboard, as the PC architecture expects. -# If enabled, the keymap file must be specified. -# -# Examples: -# keyboard_mapping: enabled=1, map=gui/keymaps/x11-pc-de.map -#======================================================================= -#keyboard_mapping: enabled=0, map=/usr/share/bochs/keymaps/x11-pc-de.map - -#======================================================================= -# KEYBOARD_TYPE: -# Type of keyboard return by a "identify keyboard" command to the -# keyboard controler. It must be one of "xt", "at" or "mf". -# Defaults to "mf". It should be ok for almost everybody. A known -# exception is french macs, that do have a "at"-like keyboard. -# -# Examples: -# keyboard_type: mf -#======================================================================= -#keyboard_type: mf - -#======================================================================= -# USER_SHORTCUT: -# This defines the keyboard shortcut to be sent when you press the "user" -# button in the headerbar. The shortcut string is a combination of maximum -# 3 key names (listed below) separated with a '-' character. -# Valid key names: -# "alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc", -# "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", -# "plus", "right", "shift", "space", "tab", "up", "win", "print" and "power". -# -# Example: -# user_shortcut: keys=ctrl-alt-del -#======================================================================= -#user_shortcut: keys=ctrl-alt-del - -#======================================================================= -# I440FXSUPPORT: -# This option controls the presence of the i440FX PCI chipset. You can -# also specify the devices connected to PCI slots. Up to 5 slots are -# available now. These devices are currently supported: ne2k, pcivga, -# pcidev, pcipnic and usb_ohci. If Bochs is compiled with Cirrus SVGA -# support you'll have the additional choice 'cirrus'. -# -# Example: -# i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k -#======================================================================= -#i440fxsupport: enabled=1 - -#======================================================================= -# USB_UHCI: -# This option controls the presence of the USB root hub which is a part -# of the i440FX PCI chipset. With the portX parameter you can connect devices -# to the hub (currently supported: 'mouse', 'tablet', 'keypad', 'disk', 'cdrom' -# 'hub' and 'printer'). -# -# The optionsX parameter can be used to assign specific options to the device -# connected to the corresponding USB port. Currently this feature is only used -# to set the speed reported by device and by the 'disk' device to specify -# an alternative redolog file of some image modes. -# -# If you connect the mouse or tablet to one of the ports, Bochs forwards the -# mouse movement data to the USB device instead of the selected mouse type. -# When connecting the keypad to one of the ports, Bochs forwards the input of -# the numeric keypad to the USB device instead of the PS/2 keyboard. -# -# To connect a 'flat' mode image as an USB hardisk you can use the 'disk' device -# with the path to the image separated with a colon. To use other disk image modes -# similar to ATA disks the syntax 'disk:mode:filename' must be used (see below). -# -# To emulate an USB cdrom you can use the 'cdrom' device name and the path to -# an ISO image or raw device name also separated with a colon. An option to -# insert/eject media is available in the runtime configuration. -# -# The device name 'hub' connects an external hub with max. 8 ports (default: 4) -# to the root hub. To specify the number of ports you have to add the value -# separated with a colon. Connecting devices to the external hub ports is only -# available in the runtime configuration. -# -# The device 'printer' emulates the HP Deskjet 920C printer. The PCL data is -# sent to a file specified in bochsrc.txt. The current code appends the PCL -# code to the file if the file already existed. It would probably be nice to -# overwrite the file instead, asking user first. -#======================================================================= -#usb_uhci: enabled=1 -#usb_uhci: enabled=1, port1=mouse, port2=disk:usbstick.img -#usb_uhci: enabled=1, port1=hub:7, port2=disk:growing:usbdisk.img -#usb_uhci: enabled=1, port2=disk:undoable:usbdisk.img, options1=journal:redo.log -#usb_uhci: enabled=1, port1=printer:printdata.bin, port2=cdrom:image.iso - -#======================================================================= -# USB_OHCI: -# This option controls the presence of the USB OHCI host controller with a -# 2-port hub. The portX option accepts the same device types with the same -# syntax as the UHCI controller (see above). The OHCI HC must be assigned to -# a PCI slot. -#======================================================================= -#usb_ohci: enabled=1 -#usb_ohci: enabled=1, port1=printer:usbprinter.bin - -#======================================================================= -# CMOSIMAGE: -# This defines image file that can be loaded into the CMOS RAM at startup. -# The rtc_init parameter controls whether initialize the RTC with values stored -# in the image. By default the time0 argument given to the clock option is used. -# With 'rtc_init=image' the image is the source for the initial time. -# -# Example: -# cmosimage: file=cmos.img, rtc_init=image -#======================================================================= -#cmosimage: file=cmos.img, rtc_init=time0 - -#======================================================================= -# MAGIC_BREAK: -# This enables the "magic breakpoint" feature when using the debugger. -# The useless cpu instruction XCHG BX, BX causes Bochs to enter the -# debugger mode. This might be useful for software development. -# -# Example: -# magic_break: enabled=1 -#======================================================================= -#magic_break: enabled=1 - -#======================================================================= -# PORT_E9_HACK: -# The 0xE9 port doesn't exists in normal ISA architecture. However, we -# define a convention here, to display on the console of the system running -# Bochs anything that is written to it. The idea is to provide debug output -# very early when writing BIOS or OS code for example, without having to -# bother with setting up a serial port or etc. Reading from port 0xE9 will -# will return 0xe9 to let you know if the feature is available. -# Leave this 0 unless you have a reason to use it. -# -# Example: -# port_e9_hack: enabled=1 -#======================================================================= -#port_e9_hack: enabled=1 - -#======================================================================= -# DEBUG_SYMBOLS: -# This loads symbols from the specified file for use in Bochs' internal -# debugger. Symbols are loaded into global context. This is equivalent to -# issuing ldsym debugger command at start up. -# -# Example: -# debug_symbols: file="kernel.sym" -# debug_symbols: file="kernel.sym", offset=0x80000000 -#======================================================================= -#debug_symbols: file="kernel.sym" - -#======================================================================= -# other stuff -#======================================================================= -#load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log -#load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img -#text_snapshot_check: enabled=1 -#print_timestamps: enabled=1 - -#------------------------- -# PCI host device mapping -#------------------------- -#pcidev: vendor=0x1234, device=0x5678 - -#======================================================================= -# GDBSTUB: -# Enable GDB stub. See user documentation for details. -# Default value is enabled=0. -#======================================================================= -#gdbstub: enabled=0, port=1234, text_base=0, data_base=0, bss_base=0 - -#======================================================================= -# PLUGIN_CTRL: -# Controls the presence of optional plugins without a separate option. -# By default all existing plugins are enabled. These plugins are currently -# supported: 'acpi', 'biosdev', 'extfpuirq', 'gameport', 'iodebug', -# 'pci_ide', 'speaker' and 'unmapped'. -#======================================================================= -#plugin_ctrl: biosdev=0, speaker=0 - -#======================================================================= -# USER_PLUGIN: -# Load user-defined plugin. This option is available only if Bochs is -# compiled with plugin support. Maximum 8 different plugins are supported. -# See the example in the Bochs sources how to write a plugin device. -#======================================================================= -#user_plugin: name=testdev -# -# -# -## -#pci: enabled=1, chipset=i440fx, slot1=cirrus -#i440fxsupport: enabled=1, slot1=cirrus -#e1000: enabled=1, mac=52:54:00:12:34:56 #, ethmod=slirp, script=slirp.conf - - diff --git a/font/Makefile b/font/Makefile deleted file mode 100644 index 2eeaf37..0000000 --- a/font/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -############ fool-font ############ -binfont.bin: binfont.src - python3.2 binarize.py $< $@ -clean: - -rm binfont.bin diff --git a/font/binarize.py b/font/binarize.py deleted file mode 100644 index 1abb9d6..0000000 --- a/font/binarize.py +++ /dev/null @@ -1,87 +0,0 @@ -import sys - -def binarize(file_in, file_out): - - """ Create a binary file from an ASCII file. Everything - but '0' and '1' (alternatively '_' and 'X') is ignored - from the input file. """ - - print ("binarizing " + file_in + " to "+ file_out + ".") - - try: - - f=open(file_in,'r') - - try: - - o=open(file_out,'wb') - - try: - - while True: - - b=readnext(f) - if b==-1: - break - - o.write(bytes([b])) - - except IOError: - print("IOError happened during processing."); - print("I am closing the input and ouput files and aborting."); - print("Warning: The output file is very likely incomplete."); - - o.close() - - except IOError: - print("IOError opening output file: " + file_out); - - f.close() - - except IOError: - print("IOError opening input file: " + file_in); - - -def readnext(f): - - """ Read next 'byte' from the given ASCII file (BufferedWriter) - everything but '_','X','0','1' is ignored. - Returns the byte as integer or -1 on EOF """ - - l=0 - b="" - - while l<8: - - c=f.read(1) - - if not c: - return -1 - - if c=="0" or c=='_': - l+=1 - b+="0" - - if c=="1" or c=='X': - l+=1 - b+="1" - - return int(b,2) - -def usage(): - - """ Prints usage information to sdtout """ - - print ("python3.x binarize.py [file_in] [file_out]") - - - -""" direct use """ - -if __name__ == "__main__": - - if(len(sys.argv)==3): - binarize(sys.argv[1],sys.argv[2]) - else: - usage() - diff --git a/font/binfont.src b/font/binfont.src deleted file mode 100644 index c1d9ccc..0000000 --- a/font/binfont.src +++ /dev/null @@ -1,1235 +0,0 @@ - -// space (ox2o) - -________ -________ -________ -________ -________ -________ -________ -________ -________ -________ - -// ! - -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -________ -________ -___XX___ -___XX___ - -// " - -_XX__XX_ -_XX__XX_ -_XX__XX_ -________ -________ -________ -________ -________ -________ -________ - -// # - -________ -__X__X__ -__X__X__ -XXXXXXXX -__X__X__ -__X__X__ -__X__X__ -XXXXXXXX -__X__X__ -__X__X__ - -// $ - -________ -___X____ -_XXXXXX_ -XX_X__XX -_XXX____ -__XXXX__ -___X_XX_ -XX_X__XX -_XXXXXX_ -___X____ - -// % - -______XX -_X___XX_ -X_X_XX__ -_X__XX__ -___XX___ -___XX___ -__XX__X_ -__XX_X_X -_XX___X_ -XX______ - -// & - -__X_____ -_X_X____ -X___X___ -_X_X____ -__XX____ -_X_X____ -X___X_X_ -X____X__ -X___X_X_ -_XXX___X - -// ' - -___XX___ -___XX___ -___XX___ -________ -________ -________ -________ -________ -________ -________ - -// ( - -___X____ -__X_____ -_X______ -_X______ -X_______ -X_______ -_X______ -_X______ -__X_____ -___X____ - -// ) - -___X____ -_____X__ -______X_ -______X_ -_______X -_______X -______X_ -______X_ -_____X__ -___X____ - -// * - -________ -________ -X__X__X_ -_X_X_X__ -__XXX___ -XXXXXXX_ -__XXX___ -_X_X_X__ -X__X__X_ -________ - -// + - -________ -________ -___XX___ -___XX___ -XXXXXXXX -XXXXXXXX -___XX___ -___XX___ -________ -________ - -// , - -________ -________ -________ -________ -________ -________ -________ -___XX___ -___XX___ -__XX____ - -// - - -________ -________ -________ -________ -_XXXXXX_ -_XXXXXX_ -________ -________ -________ -________ - -// . - -________ -________ -________ -________ -________ -________ -________ -________ -___XX___ -___XX___ - -// / -______XX -_____XX_ -____XX__ -____XX__ -___XX___ -___XX___ -__XX____ -__XX____ -_XX_____ -XX______ - -// zero - -_XXXXXX_ -XXXXXXXX -XX___XXX -XX__X_XX -XX__X_XX -XX_X__XX -XX_X__XX -XXX___XX -XXXXXXXX -_XXXXXX_ - -// one - -___XX___ -__XXX___ -__XXX___ -_XXXX___ -XX_XX___ -___XX___ -___XX___ -___XX___ -___XX___ -_XXXXXX_ - -// 2 - -_XXXXXX_ -XXXXXXXX -_____XXX -_____XXX -____XXX_ -___XXX__ -_XXX____ -XXX_____ -XXXXXXXX -XXXXXXXX - -// 3 - -XXXXXXXX -XXXXXXXX -_____XXX -____XX__ -___XX___ -__XXX___ -____XXX_ -XX___XXX -XXXXXXXX -_XXXXXX_ - -// 4 - -___XX___ -__XXX___ -__XXX___ -_XXXX___ -XX_XX___ -XXXXXXXX -XXXXXXXX -___XX___ -___XX___ -___XX___ - -// 5 - -XXXXXXXX -XXXXXXXX -XXX_____ -XXX_____ -XXXXXXX_ -_XXXXXXX -______XX -X_____XX -XXXXXXXX -_XXXXXX_ - -// 6 - -_XXXXXX_ -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// 7 - -XXXXXXXX -XXXXXXXX -_____XXX -____XXX_ -____XXX_ -___XXX__ -___XXX__ -__XXX___ -__XXX___ -_XXX____ - -// 8 - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -_XXXXXX_ -_XXXXXX_ -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// 9 - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -_XXXXXXX -_XXXXXXX -______XX -______XX -XXXXXXXX -_XXXXXX_ - - -// : - -________ -________ -________ -________ -___XX___ -___XX___ -________ -___XX___ -___XX___ -________ - - -// ; - -________ -________ -________ -________ -___XX___ -___XX___ -________ -___XX___ -___XX___ -__XX____ - -// < - -________ -________ -______XX -____XX__ -__XX____ -XX______ -__XX____ -____XX__ -______XX -________ - -// = - -________ -________ -________ -________ -XXXXXXXX -________ -XXXXXXXX -________ -________ -________ - - -// > - -________ -________ -XX______ -__XX____ -____XX__ -______XX -____XX__ -__XX____ -XX______ -________ - -// ? - - -_XXXXXX_ -XXXXXXXX -XX____XX -_X___XX_ -____XX__ -___XX___ -___XX___ -________ -___XX___ -___XX___ - -// @ - -_XXXXXX_ -XXXXXXXX -XX____XX -XX_XXXXX -XX_X__XX -XX_X__XX -XX_XXXXX -XX______ -XXXXXXXX -_XXXXXXX - - -// A - -XXXXXXXX -XXXXXXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - -// B - -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXX_ -XXXXXXX_ -XX____XX -XX____XX -XXXXXXXX -XXXXXXX_ - -// C - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XXXXXXXX -XXXXXXXX - -// D - -XXXXXX__ -XXXXXXX_ -XX___XXX -XX____XX -XX____XX -XX____XX -XX____XX -XX___XXX -XXXXXXX_ -XXXXXX__ - -// E - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX______ -XX______ -XXXXXXXX -XXXXXXXX - -// F - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX______ -XX______ -XX______ -XX______ - -// G - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XX__XXXX -XX__XXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXXX - -// H - -XX____XX -XX____XX -XX____XX -XX____XX -XXXXXXXX -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - -// I - -_XXXXXX_ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -_XXXXXX_ - -// J - -XXXXXXXX -XXXXXXXX -______XX -______XX -______XX -______XX -XX____XX -XXX___XX -_XXXXXXX -__XXXXXX - -// K - -XX____XX -XX__XXX_ -XX__XXX_ -XX_XXX__ -XXXX____ -XXXX____ -XX_XXX__ -XX__XXX_ -XX__XXX_ -XX____XX - -// L - -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XXXXXXXX -XXXXXXXX - -// M - -XX____XX -XXX__XXX -XXX_XXXX -XXXXXXXX -XXXXXXXX -XX_XX_XX -XX_XX_XX -XX____XX -XX____XX -XX____XX - -// N - -XX____XX -XXX___XX -XXX___XX -XXXX__XX -XXXXX_XX -XX_XXXXX -XX__XXXX -XX___XXX -XX___XXX -XX____XX - -// O - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// P - -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXX_ -XX______ -XX______ -XX______ -XX______ - -// Q - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX_XX_XX -XX_XXXXX -XX__XXXX -XXXXXXXX -_XXXXXXX - -// R - -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXX_ -XXXXX___ -XX_XXX__ -XX__XXX_ -XX___XXX - -// S - -_XXXXXX_ -XXXXXXXX -XX____XX -_XX___X_ -__XX____ -___XXX__ -_X__XXX_ -XX___XXX -XXXXXXXX -_XXXXXX_ - -// T - -XXXXXXXX -XXXXXXXX -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ - -// U - -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// V - -XX____XX -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -_XX__XX_ -__XXXX__ -__XXXX__ -___XX___ -___XX___ - -// W - -XX____XX -XX____XX -XX_XX_XX -XX_XX_XX -XXXXXXXX -XXXXXXXX -XXX__XXX -XXX__XXX -XX____XX -XX____XX - -// x big - -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -__XXXX__ -_XX__XX_ -_XX__XX_ -XX____XX -XX____XX - -// Y - -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -__XXXX__ -___XX___ -___XX___ -___XX___ -___XX___ - -// Z - -XXXXXXXX -XXXXXXXX -_____XXX -_____XXX -____XXX_ -___XXX__ -_XXX____ -XXX_____ -XXXXXXXX -XXXXXXXX - -// [ - -XXXX____ -XXXX____ -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XXXX____ -XXXX____ -// \ - -XX______ -_XX_____ -__XX____ -__XX____ -___XX___ -___XX___ -____XX__ -____XX__ -_____XX_ -______XX - -// ] - -____XXXX -____XXXX -______XX -______XX -______XX -______XX -______XX -______XX -____XXXX -____XXXX -// ^ - -___XX___ -__XXXX__ -_XX__XX_ -XX____XX -________ -________ -________ -________ -________ -________ - -// underscore - -________ -________ -________ -________ -________ -________ -________ -________ -XXXXXXXX -XXXXXXXX - -// ` - -__XX____ -___XX___ -____XX__ -________ -________ -________ -________ -________ -________ -________ - -// a -________ -________ -_XXXXXX_ -XXXXXXXX -______XX -_XXXXXXX -XXXXXXXX -XX____XX -XXXXXXXX -_XXXX_XX - -// b - -XX______ -XX______ -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX____XX -XX____XX -XXXXXXX_ -XXXXXXX_ - -// c - -________ -________ -________ -_XXXXXX_ -XXXXXXXX -XX______ -XX______ -XX______ -XXXXXXXX -_XXXXXX_ - -// d - -______XX -______XX -______XX -______XX -_XXXXXXX -_XXXXXXX -XX____XX -XX____XX -_XXXXXXX -_XXXXXXX - -// e - -________ -________ -_XXXXXX_ -XXXXXXXX -XX_____X -XXXXXXX_ -XX______ -XX______ -XXXXXXXX -_XXXXXX_ - -// f - -_XXXXXX_ -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX______ -XX______ -XX______ -XX______ - -// g - -________ -________ -_XXXXXXX -_XXXXXXX -XX____XX -XX____XX -_XXXXXXX -______XX -XX____XX -_XXXXXXX - -// h - -XX______ -XX______ -XX______ -XX______ -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - - -// i - -________ -________ -________ -___XX___ -________ -___XX___ -___XX___ -___XX___ -___XX___ -__XXXX__ - - -// j - -________ -________ -____XX__ -________ -____XX__ -____XX__ -____XX__ -_XX_XX__ -_XX_XX__ -__XXX___ - -// k - - -XX______ -XX______ -XX______ -XX______ -XX____XX -XX__XXX_ -XXXXXX__ -XX_XXX__ -XX__XXX_ -XX___XXX - -// l - - -_XXXX___ -_XXXX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -_XXXXXX_ - - -// m -________ -________ -________ -XX______ -XXXX_XX_ -XXXXXXXX -XX_XX_XX -XX_XX_XX -XX_XX_XX -XX_XX_XX - -// n -________ -________ -________ -XX______ -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - -// o -________ -________ -________ -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// p -________ -________ -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXX_ -XX______ -XX______ -XX______ - -// q - -________ -________ -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -_XXXXXXX -______XX -______XX -______XX - -// r -________ -________ -________ -XX__XX__ -XX_XXXX_ -XXXX__XX -XX______ -XX______ -XX______ -XX______ - -// s - -________ -________ -________ -_XXXXXX_ -XX____XX -_XX_____ -__XXXX__ -_____XX_ -XX____XX -_XXXXXX_ - -// t - -__XX____ -__XX____ -XXXXXX__ -XXXXXX__ -__XX____ -__XX____ -__XX____ -__XX__X_ -__XX_XX_ -___XXX__ - -// u -________ -________ -________ -________ -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -_XXXXXX_ - -// v -________ -________ -________ -________ -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -___XX___ - -// w -________ -________ -________ -________ -XX_XX_XX -XX_XX_XX -XX_XX_XX -XX_XX_XX -XXXXXXXX -_XX__XX_ - - -// x - -________ -________ -________ -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -_XX__XX_ -_XX__XX_ -XX____XX - - -// y - -________ -________ -________ -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -___XX___ -__XX____ -_XX_____ - - -// z -________ -________ -________ -________ -XXXXXXXX -_____XX_ -____XX__ -__XXX___ -_XX_____ -XXXXXXXX - -// { - -____XX__ -___X____ -__X_____ -__X_____ -XX______ -XX______ -__X_____ -__X_____ -___X____ -____XX__ - -// | - -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ - -// } - -__XX____ -____X___ -_____X__ -_____X__ -______XX -______XX -_____X__ -_____X__ -____X___ -__XX____ - -// ~ - -________ -________ -________ -_XX_____ -X__XX__X -_____XX_ -________ -________ -________ -________ diff --git a/fs/file.c b/fs/file.c new file mode 100644 index 0000000..609da63 --- /dev/null +++ b/fs/file.c @@ -0,0 +1,2 @@ +#include "file.h" + diff --git a/fs/file.h b/fs/file.h new file mode 100644 index 0000000..481a173 --- /dev/null +++ b/fs/file.h @@ -0,0 +1,14 @@ +#ifndef FILE_H +#define FILE_H + +#include + +typedef struct file_struct +{ + + uint32_t file_id; + + +}file; + +#endif diff --git a/kernel/config.h b/kernel/config.h index 74304d8..0a6fd3c 100644 --- a/kernel/config.h +++ b/kernel/config.h @@ -8,7 +8,7 @@ #define FOOLOS_CONFIG_H #define FOOLOS_CONSOLE_AUTOBREAK // add newline automatically at end of line -#define FOOLOS_LOG_OFF // do not log anything +#define FOOLOS_LOG_OFF // do not log anything #define FOOLOS_CONSOLE // otherwise VESA will be used! #define FOOLSOS_SHOW_VESAMODES #define MEM_PRINT_MEMORYMAP diff --git a/kernel/console.c b/kernel/console.c deleted file mode 100644 index 593801a..0000000 --- a/kernel/console.c +++ /dev/null @@ -1,60 +0,0 @@ -// http://invisible-island.net/xterm/ctlseqs/ctlseqs.html -// http://invisible-island.net/vttest/ -// http://www.xfree86.org/4.7.0/ctlseqs.html - - -#include "kernel/config.h" -#include "lib/logger/log.h" -#include "fs/ext2.h" - - -#define FOOLOS_MODULE_NAME "console" - -#ifdef FOOLOS_CONSOLE - -#include "video/console.h" - -uint32_t console_init(){ - scr_clear(); - return 0; -} - -void console_del_char(){scr_backspace();} -void console_put_char_gray(char c){scr_put_char(c,SCR_GRAY2);} -void console_put_char_white(char c){scr_put_char(c,SCR_WHITE);} -void console_put_char_green(char c){scr_put_char(c,SCR_GREEN);} -void console_put_char_red(char c){scr_put_char(c,SCR_RED);} - -void console_put_str_gray(char *s){scr_put_string(s,SCR_GRAY2);} -void console_put_str_white(char *s){scr_put_string(s,SCR_WHITE);} -void console_put_str_green(char *s){scr_put_string(s,SCR_GREEN);} -void console_put_str_red(char *s){scr_put_string(s,SCR_RED);} - -#else - -#include "video/vesa.h" - -uint32_t console_init(uint32_t mode, uint32_t control){ - - int inode_nr=ext2_filename_to_inode(EXT2_RAM_ADDRESS,"/binfont.bin"); - ext2_inode_content(EXT2_RAM_ADDRESS,inode_nr,0x700000,0xffff); // load font; - //uint32_t vesa_physbase=vesa_init(0xb000,0xc000,0x700000); - uint32_t vesa_physbase=vesa_init(mode,control,0x700000); - return vesa_physbase; -} - -void console_del_char(char c){PutConsoleChar('*',0xffffff);} -void console_put_char(char c){PutConsoleChar(c,0xffffff);} -void console_put_char_gray(char c){PutConsoleChar(c,0xffffff);} -void console_put_char_white(char c){PutConsoleChar(c,0xffffff);} -void console_put_char_green(char c){PutConsoleChar(c,0xffffff);} -void console_put_char_red(char c){PutConsoleChar(c,0xffffff);} -void console_put_str(char *s){PutConsole(s,0xffffff);} -void console_put_str_gray(char *s){PutConsole(s,0xffffff);} -void console_put_str_white(char *s){PutConsole(s,0xffffff);} -void console_put_str_green(char *s){PutConsole(s,0xffffff);} -void console_put_str_red(char *s){PutConsole(s,0xffffff);} - -#endif - - diff --git a/kernel/console.h b/kernel/console.h deleted file mode 100644 index 4c56a5a..0000000 --- a/kernel/console.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef CONSOLE_H -#define CONSOLE_H - -#include - -uint32_t console_init(); -void console_put_char(uint8_t c,uint8_t color, uint32_t x, uint32_t y); -void console_put_char_white(char); -void console_put_char_red(char); -void console_put_char_green(char); -void console_put_char_gray(char); -void console_put_str_white(char *); -void console_put_str_red(char *); -void console_put_str_green(char *); -void console_put_str_gray(char *); -void console_del_char(); - - -#endif diff --git a/kernel/interrupts.c b/kernel/interrupts.c index d75ec4d..a7eae81 100644 --- a/kernel/interrupts.c +++ b/kernel/interrupts.c @@ -4,7 +4,6 @@ #include "asm/asm.h" #include "interrupts.h" -#include "console.h" #include "x86.h" void errlog(uint32_t error_code) diff --git a/kernel/kernel.c b/kernel/kernel.c index 0a4b863..de435c5 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -18,19 +18,17 @@ #include "interrupts.h" #include "multiboot.h" -#include "console.h" #include // for built-in shell #include "lib/buffer/ringbuffer.h" #include "task.h" -#include "video/vesa.h" +#include "video/console.h" #include "multiboot.h" #include "terminal/vt52.h" - // // The Foolish structure of Fool OS! // @@ -45,15 +43,26 @@ fool_os *get_fool() void kernel_main(uint32_t eax,uint32_t ebx) { - // - // Setup main tty + // Setup terminal output // - scr_clear(); - term_screen screen; + term_out screen; screen.put_char=console_put_char; + screen.update_cursor=update_cursor; + vt52_tty tty=vt52_init(&screen); + get_fool()->tty1=&tty; + + // + // Setup terminal input + // + /* + term_in keyboard; + kb.get_char=console_put_char; + screen.update_cursor=update_cursor; vt52_tty tty=vt52_init(&screen); get_fool()->tty1=&tty; + */ + // diff --git a/kernel/keyboard.c b/kernel/keyboard.c index 0274748..b586d0f 100644 --- a/kernel/keyboard.c +++ b/kernel/keyboard.c @@ -1,7 +1,6 @@ #define FOOLOS_MODULE_NAME "keyboard" #include "x86.h" -#include "console.h" #include "lib/buffer/ringbuffer.h" #include "lib/logger/log.h" // logger facilities diff --git a/kernel/syscalls.c b/kernel/syscalls.c index 6bd51d1..1d63ba4 100644 --- a/kernel/syscalls.c +++ b/kernel/syscalls.c @@ -4,7 +4,6 @@ #include "lib/logger/log.h" #include "fs/fs.h" #include "fs/ext2.h" -#include "kernel/console.h" #include "kernel/kernel.h" #include "kernel/config.h" #include "terminal/vt52.h" @@ -84,7 +83,7 @@ int syscall_read(int file, char *buf, int len) { if(l>0) { - console_del_char(); + //console_del_char(); buf--; l--; } @@ -94,7 +93,7 @@ int syscall_read(int file, char *buf, int len) *buf=c; buf++; l++; - if(c!=0x04)console_put_char_white(c); + //if(c!=0x04)console_put_char_white(c); if(c=='\n')return l; if(c==0x04) { diff --git a/kernel/task.c b/kernel/task.c index 495817c..36ccafe 100644 --- a/kernel/task.c +++ b/kernel/task.c @@ -6,7 +6,6 @@ #include "lib/buffer/ringbuffer.h" #include "mem.h" #include "timer.h" -#include "console.h" #include "x86.h" #include "vmem.h" diff --git a/lib/logger/log.c b/lib/logger/log.c index 7d58458..430f982 100644 --- a/lib/logger/log.c +++ b/lib/logger/log.c @@ -5,7 +5,6 @@ #include "log.h" #include "kernel/config.h" -#include "kernel/console.h" #include "terminal/vt52.h" #include "lib/printf/printf.h" #include "kernel/timer.h" @@ -63,7 +62,7 @@ void panic(char *module_name, char *message) { char buf_log[256]; tfp_sprintf(buf_log,"KERNEL PANIC !! %s: %s\n",module_name,message); - console_put_str_red(buf_log); + //console_put_str_red(buf_log); while(1) { diff --git a/terminal/vt52.c b/terminal/vt52.c index 4a9cb0a..9ff1150 100644 --- a/terminal/vt52.c +++ b/terminal/vt52.c @@ -1,16 +1,43 @@ // // http://en.wikipedia.org/wiki/VT52 +// http://vt100.net/docs/vt520-rm/ // - #include "vt52.h" #include "kernel/kmalloc.h" - -//TODO: check? #define VT52_WIDTH 80 #define VT52_HEIGHT 25 -#define VT52_ESC 0x33 + + +#define VT52_ESC_1 0x1b //ESC +#define VT52_ESC_2 0x5b //[ + +#define VT52_UP 'A' +#define VT52_DOWN 'B' +#define VT52_RIGHT 'C' +#define VT52_LEFT 'D' +#define VT52_GRAPH_ON 'F' +#define VT52_GRAPH_OFF 'G' +#define VT52_HOME 'H' +#define VT52_REV_FEED 'I' +#define VT52_ERASE_SCR 'J' +#define VT52_ERASE_LINE 'K' +#define VT52_KEYPAD_ON '=' +#define VT52_KEYPAD_OFF '>' + +#define VT52_EXIT '<' + +#define VT52_ENTER_AUTOPRINT '^' +#define VT52_EXIT_AUTOPRINT '_' + +#define VT52_PRINT_LINE 'W' +#define VT52_ENTER_PRINT 'W' +#define VT52_EXIT_PRINT 'X' +#define VT52_PRINT ']' +#define VT52_JUMP 'Y' // followed by LINE COL (subtr -32 from val) +#define VT52_IDENTIFY 'Z' +#define VT52_IDENTIFY_TO_HOST "/Z" static uint32_t index(vt52_tty *tty, uint32_t x, uint32_t y) { @@ -22,14 +49,13 @@ static void clear(vt52_tty *tty) for(int x=0;xwidth;x++) for(int y=0;yheight;y++) { - tty->data[index(tty,x,y)]='.'; - tty->screen->put_char('.',0xf,x,y); + tty->data[index(tty,x,y)]=' '; + tty->screen->put_char(' ',0xf,x,y); } } -vt52_tty vt52_init(term_screen *screen) +vt52_tty vt52_init(term_out *screen) { - vt52_tty tty; tty.data=kballoc(1); @@ -52,9 +78,79 @@ static void set_char(vt52_tty *tty, uint32_t x, uint32_t y, uint32_t c) tty->data[index(tty,x,y)]=c; } +static uint8_t escaping=0; + // send one ASCII character to the terminal void vt52_put(vt52_tty *tty, uint8_t c) { + if(c==VT52_ESC_1){escaping=1;return;} + if(c==VT52_ESC_2){if(escaping==1)escaping=2;return;} + + if(escaping==3){tty->x=c-32; escaping++;return;} //TODO: check for overflow? + if(escaping==4){tty->y=c-32; escaping=0;return;} + + if(escaping==2) // two last characters are escape seq: ^[ + { + if(c==VT52_JUMP)escaping++; + + else + { + switch('c') + { + case VT52_UP: + if(tty->y>0)tty->y--; + break; + + case VT52_DOWN: + if(tty->y+1height)tty->y++; + break; + + case VT52_LEFT: + if(tty->x+1width)tty->x++; + break; + + case VT52_RIGHT: + if(tty->x>0)tty->x--; + break; + + case VT52_HOME: + tty->x=tty->y=0; + break; + + case VT52_REV_FEED: + + break; + + case VT52_ERASE_SCR: + for(uint32_t y=tty->y+1;yheight;y++) + { + for(uint32_t x=0;xwidth-1;x++) + { + uint32_t c=tty->data[index(tty,x,y+1)]; + tty->data[index(tty,x,y)] = c; + tty->screen->put_char(c,0xf,x,y); + } + } + case VT52_ERASE_LINE: + + for(uint32_t x=tty->x;xwidth-1;x++) + { + uint32_t c=tty->data[index(tty,x,tty->y)]; + tty->data[index(tty,x,tty->y)] = c; + tty->screen->put_char(c,0xf,x,tty->y); + } + + break; + + } + + escaping=0; + } + + return; + + } + if(c!='\n') { tty->data[index(tty,tty->x,tty->y)]=c; @@ -87,10 +183,8 @@ void vt52_put(vt52_tty *tty, uint8_t c) tty->screen->put_char(c,0xf,x,y); } } - for(uint32_t x=0;xwidth;x++) - { - } - - } + + tty->screen->update_cursor(tty->x,tty->y); } + diff --git a/terminal/vt52.h b/terminal/vt52.h index 557c247..cdc62bd 100644 --- a/terminal/vt52.h +++ b/terminal/vt52.h @@ -7,13 +7,13 @@ // REQUIREMENTS // * kballoc // block wise in-kernel allocation - -typedef struct term_screen_struct +typedef struct term_out_struct { - + void (*put_char)(uint8_t c,uint8_t color, uint32_t x, uint32_t y); + void (*update_cursor)(uint32_t col,uint32_t row); -}term_screen; +}term_out; typedef struct vt52_tty_struct { @@ -23,11 +23,11 @@ typedef struct vt52_tty_struct uint32_t x; uint32_t y; uint32_t *data; // screen data - term_screen *screen; + term_out *screen; }vt52_tty; -vt52_tty vt52_init(term_screen *screen); +vt52_tty vt52_init(term_out *screen); void vt52_put(vt52_tty *tty, uint8_t c); #endif diff --git a/userspace/Makefile b/userspace/Makefile index b591280..48d9b1f 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -30,7 +30,7 @@ ext2.img: $(PROGS) ../mp/mp.bin cp $^ mnt/bin echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++." > mnt/home/miguel/hello.brain # cp ~/temp/fool-os-stuff/binutils-build-host-foolos/binutils/readelf mnt/bin - cp ../font/binfont.bin mnt/ +# cp ../font/binfont.bin mnt/ cp ~/temp/fool-os-stuff/ncurses-5.9/progs/tput mnt/bin cp ../mp/mp.bin mnt/boot/ mkdir -p mnt/etc diff --git a/userspace/foolshell.c b/userspace/foolshell.c index da05e96..84d24b0 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -46,6 +46,14 @@ int main(int argc, char **argv) char *buf=malloc(256); // printf("malloc returned: 0x%08X\n",buf); + // + while(1) + { + fgets(buf,2,stdin); + buf[1]=0; + puts(buf); + } + while(1) { diff --git a/video/console.c b/video/console.c index c1b9c5c..b6958c5 100644 --- a/video/console.c +++ b/video/console.c @@ -6,16 +6,23 @@ static int posx=0; static int posy=0; +static void scr_nextline(); -// glue func for vt52 terminal -void console_put_char(uint8_t c,uint8_t color, uint32_t x, uint32_t y) +void update_cursor(uint32_t col,uint32_t row) { + unsigned short position=(row*80) + col; + + // cursor LOW port to vga INDEX register + x86_outb(0x3D4, 0x0F); + x86_outb(0x3D5, (unsigned char)(position&0xFF)); + // cursor HIGH port to vga INDEX register + x86_outb(0x3D4, 0x0E); + x86_outb(0x3D5, (unsigned char )((position>>8)&0xFF)); + } - print_char_col(x,y,c, color); -} // helper_funcs -void print_char_col(int x, int y, char c, char col) +static void print_char_col(int x, int y, char c, char col) { #ifdef FOOLOS_CONSOLE @@ -26,12 +33,20 @@ void print_char_col(int x, int y, char c, char col) } -void print_char(int x, int y, char c) +// glue func for vt52 terminal +void console_put_char(uint8_t c,uint8_t color, uint32_t x, uint32_t y) +{ + + print_char_col(x,y,c, color); +} +// +// +static void print_char(int x, int y, char c) { print_char_col(x,y,c,SCR_WHITE); } -void print_single_num(int i) +static void print_single_num(int i) { if(i<10)print_char_col(posx,posy,'0'+i,SCR_GREEN); else if(i<16)print_char_col(posx,posy,'A'+i-10,SCR_GREEN); @@ -40,7 +55,7 @@ void print_single_num(int i) } -void print_str_col(int x,int y,char *str, char col) +static void print_str_col(int x,int y,char *str, char col) { while(*str!=0) @@ -50,7 +65,7 @@ void print_str_col(int x,int y,char *str, char col) } -void print_str(int x,int y,char *str) +static void print_str(int x,int y,char *str) { print_str_col(x,y,str,SCR_WHITE); } @@ -82,7 +97,7 @@ void scr_put_string_nl(char *str) } */ -void scr_nextline() +static void scr_nextline() { #ifdef FOOLOS_CONSOLE int i,x; @@ -117,7 +132,7 @@ void scr_nextline() #endif } -void scr_put_char(char ch,char col) +static void scr_put_char(char ch,char col) { if(ch=='\n')scr_nextline(); @@ -163,7 +178,7 @@ void scr_put_hex32(uint32_t val) } */ -void scr_put_string(char *str, char col) +static void scr_put_string(char *str, char col) { while(*str!=0) { @@ -171,7 +186,7 @@ void scr_put_string(char *str, char col) } } -void scr_backspace() +static void scr_backspace() { if(posx==0)return; print_char_col(posx-1,posy,' ',SCR_LGREEN); diff --git a/video/console.h b/video/console.h index a89e0f5..819bd8d 100644 --- a/video/console.h +++ b/video/console.h @@ -1,8 +1,7 @@ #ifndef CONSOLEINT_H #define CONSOLEINT_H -// 80 x 24 -// TODO: implement VT100 +// 80 x 24 ? #include @@ -35,13 +34,7 @@ #define SCR_WHITE 0xf //autoscroll -void scr_clear(); - - -void scr_nextline(); -void scr_backspace(); -void scr_put_char(char ch,char col); -void scr_put_string(char *str, char col); - +void update_cursor(uint32_t col,uint32_t row); +void console_put_char(uint8_t c,uint8_t color, uint32_t x, uint32_t y); #endif diff --git a/xxx/bochs/bochsdebug b/xxx/bochs/bochsdebug new file mode 100644 index 0000000..fabafe9 --- /dev/null +++ b/xxx/bochs/bochsdebug @@ -0,0 +1,2 @@ +continue + diff --git a/xxx/bochs/bochsrc b/xxx/bochs/bochsrc new file mode 100644 index 0000000..47a7d3f --- /dev/null +++ b/xxx/bochs/bochsrc @@ -0,0 +1,965 @@ +# +# +# +## You may now use double quotes around pathnames, in case +# your pathname includes spaces. + +#======================================================================= +# CONFIG_INTERFACE +# +# The configuration interface is a series of menus or dialog boxes that +# allows you to change all the settings that control Bochs's behavior. +# Depending on the platform there are up to 3 choices of configuration +# interface: a text mode version called "textconfig" and two graphical versions +# called "win32config" and "wx". The text mode version uses stdin/stdout and +# is always compiled in, unless Bochs is compiled for wx only. The choice +# "win32config" is only available on win32 and it is the default there. +# The choice "wx" is only available when you use "--with-wx" on the configure +# command. If you do not write a config_interface line, Bochs will +# choose a default for you. +# +# NOTE: if you use the "wx" configuration interface, you must also use +# the "wx" display library. +#======================================================================= +#config_interface: textconfig +#config_interface: wx + +#======================================================================= +# DISPLAY_LIBRARY +# +# The display library is the code that displays the Bochs VGA screen. Bochs +# has a selection of about 10 different display library implementations for +# different platforms. If you run configure with multiple --with-* options, +# the display_library command lets you choose which one you want to run with. +# If you do not write a display_library line, Bochs will choose a default for +# you. +# +# The choices are: +# x use X windows interface, cross platform +# sdl use SDL library, cross platform +# svga use SVGALIB library for Linux, allows graphics without X11 +# term text only, uses curses/ncurses library, cross platform +# rfb provides an interface to AT&T's VNC viewer, cross platform +# wx use wxWidgets library, cross platform +# nogui no display at all +# +# NOTE: if you use the "wx" configuration interface, you must also use +# the "wx" display library. +# +# Specific options: +# Some display libraries now support specific option to control their +# behaviour. See the examples below for currently supported options. +#======================================================================= +#display_library: rfb, options="timeout=60" # time to wait for client +#display_library: sdl #, options="fullscreen" # startup in fullscreen mode +#display_library: term +#display_library: wx +#display_library: x, options="hideIPS" # disable IPS output in status bar +display_library: x, options="gui_debug" # use GTK debugger gui +#display_library: term +#display_library: x +# + +#======================================================================= +# ROMIMAGE: +# The ROM BIOS controls what the PC does when it first powers on. +# Normally, you can use a precompiled BIOS in the source or binary +# distribution called BIOS-bochs-latest. The ROM BIOS is usually loaded +# starting at address 0xf0000, and it is exactly 64k long. Another option +# is 128k BIOS which is loaded at address 0xe0000. +# You can also use the environment variable $BXSHARE to specify the +# location of the BIOS. +# The usage of external large BIOS images (up to 512k) at memory top is +# now supported, but we still recommend to use the BIOS distributed with +# Bochs. The start address optional, since it can be calculated from image size. +#======================================================================= +#romimage: file=/usr/share/bochs/BIOS-bochs-latest +#romimage: file=bios/seabios-0.5.1.bin +#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top +#romimage: file=/home/miguel/opt/bochs-2.6.6/bios/BIOS-bochs-latest + + +#======================================================================= +# CPU: +# This defines cpu-related parameters inside Bochs: +# +# COUNT: +# Set the number of processors:cores per processor:threads per core +# when Bochs is compiled for SMP emulation. +# Bochs currently supports up to 8 threads running simultaniosly. +# If Bochs is compiled without SMP support, it won't accept values +# different from 1. +# +# QUANTUM: +# Maximum amount of instructions allowed to execute by processor before +# returning control to another cpu. This option exists only in Bochs +# binary compiled with SMP support. +# +# RESET_ON_TRIPLE_FAULT: +# Reset the CPU when triple fault occur (highly recommended) rather than +# PANIC. Remember that if you trying to continue after triple fault the +# simulation will be completely bogus ! +# +# MSRS: +# Define path to user CPU Model Specific Registers (MSRs) specification. +# See example in msrs.def. +# +# IGNORE_BAD_MSRS: +# Ignore MSR references that Bochs does not understand; print a warning +# message instead of generating #GP exception. This option is enabled +# by default but will not be avaiable if configurable MSRs are enabled. +# +# IPS: +# Emulated Instructions Per Second. This is the number of IPS that bochs +# is capable of running on your machine. You can recompile Bochs with +# --enable-show-ips option enabled, to find your host's capability. +# Measured IPS value will then be logged into your log file or shown +# in the status bar (if supported by the gui). +# +# IPS is used to calibrate many time-dependent events within the bochs +# simulation. For example, changing IPS affects the frequency of VGA +# updates, the duration of time before a key starts to autorepeat, and +# the measurement of BogoMips and other benchmarks. +# +# Examples: +# +# Bochs Machine/Compiler Mips +# ____________________________________________________________________ +# 2.3.7 3.2Ghz Intel Core 2 Q9770 with WinXP/g++ 3.4 50 to 55 Mips +# 2.3.7 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 38 to 43 Mips +# 2.2.6 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 21 to 25 Mips +# 2.2.6 2.1Ghz Athlon XP with Linux 2.6/g++ 3.4 12 to 15 Mips +# 2.0.1 1.6Ghz Intel P4 with Win2000/g++ 3.3 5 to 7 Mips +#======================================================================= +cpu: count=2 #, ips=1000000 #, reset_on_triple_fault=1, ignore_bad_msrs=1, msrs="msrs.def" + +#======================================================================= +# CPUID: +# +# This defines features and functionality supported by Bochs emulated CPU: +# +# MMX: +# Select MMX instruction set support. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 5. +# +# SEP: +# Select SYSENTER/SYSEXIT instruction set support. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +# +# SSE: +# Select SSE instruction set support. +# Any of NONE/SSE/SSE2/SSE3/SSSE3/SSE4_1/SSE4_2 could be selected. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +# +# XAPIC: +# Select XAPIC extensions support. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +# +# AES: +# Select AES instruction set support. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +# +# MOVBE: +# Select MOVBE Intel(R) Atom instruction support. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +# +# XSAVE: +# Select XSAVE extensions support. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +# +# 1G_PAGES: +# Enable 1G page size support in long mode. +# This option exists only if Bochs compiled with x86-64 support. +# +# PCID: +# Enable Process-Context Identifiers (PCID) support in long mode. +# This option exists only if Bochs compiled with x86-64 support. +# +# FSGSBASE: +# Enable GS/GS BASE access instructions support in long mode. +# This option exists only if Bochs compiled with x86-64 support. +# +# MWAIT: +# Select MONITOR/MWAIT instructions support. +# This option exists only if Bochs compiled with --enable-monitor-mwait. +# +# MWAIT_IS_NOP: +# When this option is enabled MWAIT will not put the CPU into a sleep state. +# This option exists only if Bochs compiled with --enable-monitor-mwait. +# +# VENDOR_STRING: +# Set the CPUID vendor string returned by CPUID(0x0). This should be a +# twelve-character ASCII string. +# +# BRAND_STRING: +# Set the CPUID vendor string returned by CPUID(0x80000002 .. 0x80000004). +# This should be at most a forty-eight-character ASCII string. +# +# STEPPING: +# Set stepping information returned by CPUID. Default stepping value is 3. +# +# CPUID_LIMIT_WINNT: +# Determine whether to limit maximum CPUID function to 3. This mode is +# required to workaround WinNT installation and boot issues. +#======================================================================= +#cpuid: mmx=1, sep=1, sse=sse4_2, xapic=1, aes=1, movbe=1, xsave=1 +#cpuid: stepping=5 +#cpuid: cpuid_limit_winnt=0 +#cpuid: mmx=1, sep=1, sse=sse4_2, xapic=1, aes=1, movbe=1, xsave=1 + +#======================================================================= +# MEMORY +# Set the amount of physical memory you want to emulate. +# +# GUEST: +# Set amount of guest physical memory to emulate. The default is 32MB, +# the maximum amount limited only by physical address space limitations. +# +# HOST: +# Set amount of host memory you want to allocate for guest RAM emulation. +# It is possible to allocate less memory than you want to emulate in guest +# system. This will fake guest to see the non-existing memory. Once guest +# system touches new memory block it will be dynamically taken from the +# memory pool. You will be warned (by FATAL PANIC) in case guest already +# used all allocated host memory and wants more. +# +#======================================================================= +memory: guest=128, host=1024 + +#======================================================================= +# OPTROMIMAGE[1-4]: +# You may now load up to 4 optional ROM images. Be sure to use a +# read-only area, typically between C8000 and EFFFF. These optional +# ROM images should not overwrite the rombios (located at +# F0000-FFFFF) and the videobios (located at C0000-C7FFF). +# Those ROM images will be initialized by the bios if they contain +# the right signature (0x55AA) and a valid checksum. +# It can also be a convenient way to upload some arbitrary code/data +# in the simulation, that can be retrieved by the boot loader +#======================================================================= +#optromimage1: file=optionalrom.bin, address=0xd0000 +#optromimage2: file=optionalrom.bin, address=0xd1000 +#optromimage3: file=optionalrom.bin, address=0xd2000 +#optromimage4: file=optionalrom.bin, address=0xd3000 + +#optramimage1: file=FoolData.img, address=0x90000 +#optramimage2: file=/path/file2.img, address=0x0020000 +#optramimage3: file=/path/file3.img, address=0x0030000 +#optramimage4: file=/path/file4.img, address=0x0040000 + +#======================================================================= +# VGAROMIMAGE +# You now need to load a VGA ROM BIOS into C0000. +#======================================================================= +#vgaromimage: file=/usr/share/vgabios/vgabios.bin +#vgaromimage: file=/usr/share/vgabios/vgabios.qxl.bin +#vgaromimage: file=/home/miguel/temp/vgabios-0.7a.bin +#vgaromimage: file=/home/miguel/temp/vgabios-0.7a.cirrus.bin +# +#vgaromimage: file=/usr/share/vgabios/vgabios.qxl.bin +#vgaromimage: file=/usr/share/vgabios/vgabios.debug.bin +#vgaromimage: file=/usr/share/vgabios/vgabios.cirrus.bin +#vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest +#vgaromimage: file=/home/miguel/opt/bochs-2.6.6/bios/VGABIOS-lgpl-latest-cirrus + +#======================================================================= +# VGA: +# Here you can specify the display extension to be used. With the value +# 'none' you can use standard VGA with no extension. Other supported +# values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support. +#======================================================================= +#vga: extension=vbe +#vga: extension=cirrus + +#======================================================================= +# FLOPPYA: +# Point this to pathname of floppy image file or device +# This should be of a bootable floppy(image/device) if you're +# booting from 'a' (or 'floppy'). +# +# You can set the initial status of the media to 'ejected' or 'inserted'. +# floppya: 2_88=path, status=ejected (2.88M 3.5" media) +# floppya: 1_44=path, status=inserted (1.44M 3.5" media) +# floppya: 1_2=path, status=ejected (1.2M 5.25" media) +# floppya: 720k=path, status=inserted (720K 3.5" media) +# floppya: 360k=path, status=inserted (360K 5.25" media) +# floppya: 320k=path, status=inserted (320K 5.25" media) +# floppya: 180k=path, status=inserted (180K 5.25" media) +# floppya: 160k=path, status=inserted (160K 5.25" media) +# floppya: image=path, status=inserted (guess media type from image size) +# floppya: 1_44=vvfat:path, status=inserted (use directory as VFAT media) +# floppya: type=1_44 (1.44M 3.5" floppy drive, no media) +# +# The path should be the name of a disk image file. On Unix, you can use a raw +# device name such as /dev/fd0 on Linux. On win32 platforms, use drive letters +# such as a: or b: as the path. The parameter 'image' works with image files +# only. In that case the size must match one of the supported types. +# The parameter 'type' can be used to enable the floppy drive without media +# and status specified. Usually the drive type is set up based on the media type. +# The optional parameter 'write_protected' can be used to control the media +# write protect switch. By default it is turned off. +#======================================================================= +#floppya: 1_44=FoolOS.img, status=inserted +#floppya: image=../1.44, status=inserted +#floppya: 1_44=/dev/fd0H1440, status=inserted +#floppya: 1_2=../1_2, status=inserted +#floppya: 1_44=a:, status=inserted +#floppya: 1_44=a.img, status=inserted, write_protected=1 +#floppya: 1_44=/dev/rfd0a, status=inserted + +#======================================================================= +# FLOPPYB: +# See FLOPPYA above for syntax +#======================================================================= +#floppyb: 1_44=b:, status=inserted +#floppyb: 1_44=b.img, status=inserted + +#======================================================================= +# ATA0, ATA1, ATA2, ATA3 +# ATA controller for hard disks and cdroms +# +# ata[0-3]: enabled=[0|1], ioaddr1=addr, ioaddr2=addr, irq=number +# +# These options enables up to 4 ata channels. For each channel +# the two base io addresses and the irq must be specified. +# +# ata0 and ata1 are enabled by default with the values shown below +# +# Examples: +# ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +# ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 +# ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 +# ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9 +#======================================================================= +#ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +#ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 +#ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 +#ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9 + +#======================================================================= +# ATA[0-3]-MASTER, ATA[0-3]-SLAVE +# +# This defines the type and characteristics of all attached ata devices: +# type= type of attached device [disk|cdrom] +# mode= only valid for disks [flat|concat|external|dll|sparse|vmware3] +# mode= only valid for disks [undoable|growing|volatile|vvfat] +# path= path of the image / directory +# cylinders= only valid for disks +# heads= only valid for disks +# spt= only valid for disks +# status= only valid for cdroms [inserted|ejected] +# biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos] +# translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto] +# model= string returned by identify device command +# journal= optional filename of the redolog for undoable, volatile and vvfat disks +# +# Point this at a hard disk image file, cdrom iso file, or physical cdrom +# device. To create a hard disk image, try running bximage. It will help you +# choose the size and then suggest a line that works with it. +# +# In UNIX it may be possible to use a raw device as a Bochs hard disk, +# but WE DON'T RECOMMEND IT. In Windows there is no easy way. +# +# In windows, the drive letter + colon notation should be used for cdroms. +# Depending on versions of windows and drivers, you may only be able to +# access the "first" cdrom in the system. On MacOSX, use path="drive" +# to access the physical drive. +# +# The path is mandatory for hard disks. Disk geometry autodetection works with +# images created by bximage if CHS is set to 0/0/0 (cylinders are calculated +# using heads=16 and spt=63). For other hard disk images and modes the +# cylinders, heads, and spt are mandatory. In all cases the disk size reported +# from the image must be exactly C*H*S*512. +# +# Default values are: +# mode=flat, biosdetect=auto, translation=auto, model="Generic 1234" +# +# The biosdetect option has currently no effect on the bios +# +# Examples: + ata0-master: type=disk, mode=flat, path=disk.img #, cylinders=10, heads=4, spt=18 +# ata0-master: type=disk, mode=flat, path=disk.img +# ata0-slave: type=disk, mode=flat, path=20M.sample, cylinders=615, heads=4, spt=17 +# ata1-master: type=disk, mode=flat, path=30M.sample, cylinders=615, heads=6, spt=17 +# ata1-slave: type=disk, mode=flat, path=46M.sample, cylinders=940, heads=6, spt=17 +# ata2-master: type=disk, mode=flat, path=62M.sample, cylinders=940, heads=8, spt=17 +# ata2-slave: type=disk, mode=flat, path=112M.sample, cylinders=900, heads=15, spt=17 +# ata3-master: type=disk, mode=flat, path=483M.sample, cylinders=1024, heads=15, spt=63 +# ata3-slave: type=cdrom, path=iso.sample, status=inserted +#======================================================================= +#ata0-master: type=disk, mode=flat, path="d.sample" +#ata0-master: type=disk, mode=flat, path="$HOME/.bochs/guest.hd0", cylinders=#cylinders#, heads=16, spt=63 +#ata0-master: type=disk, mode=flat, path="c.img", cylinders=0 # autodetect +#ata0-slave: type=disk, mode=vvfat, path=/bochs/images/vvfat, journal=vvfat.redolog +#ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted + +#======================================================================= +# BOOT: +# This defines the boot sequence. Now you can specify up to 3 boot drives, +# which can be 'floppy', 'disk', 'cdrom' or 'network' (boot ROM). +# Legacy 'a' and 'c' are also supported. +# Examples: +# boot: floppy +# boot: cdrom, disk +# boot: network, disk +# boot: cdrom, floppy, disk +#======================================================================= +#boot: floppy +boot: disk +#boot: floppy + +#======================================================================= +# CLOCK: +# This defines the parameters of the clock inside Bochs: +# +# SYNC: +# This defines the method how to synchronize the Bochs internal time +# with realtime. With the value 'none' the Bochs time relies on the IPS +# value and no host time synchronization is used. The 'slowdown' method +# sacrifices performance to preserve reproducibility while allowing host +# time correlation. The 'realtime' method sacrifices reproducibility to +# preserve performance and host-time correlation. +# It is possible to enable both synchronization methods. +# +# TIME0: +# Specifies the start (boot) time of the virtual machine. Use a time +# value as returned by the time(2) system call. If no time0 value is +# set or if time0 equal to 1 (special case) or if time0 equal 'local', +# the simulation will be started at the current local host time. +# If time0 equal to 2 (special case) or if time0 equal 'utc', +# the simulation will be started at the current utc time. +# +# Syntax: +# clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc] +# +# Example: +# clock: sync=none, time0=local # Now (localtime) +# clock: sync=slowdown, time0=315529200 # Tue Jan 1 00:00:00 1980 +# clock: sync=none, time0=631148400 # Mon Jan 1 00:00:00 1990 +# clock: sync=realtime, time0=938581955 # Wed Sep 29 07:12:35 1999 +# clock: sync=realtime, time0=946681200 # Sat Jan 1 00:00:00 2000 +# clock: sync=none, time0=1 # Now (localtime) +# clock: sync=none, time0=utc # Now (utc/gmt) +# +# Default value are sync=none, time0=local +#======================================================================= +#clock: sync=realtime, time0=local + + +#======================================================================= +# FLOPPY_BOOTSIG_CHECK: disabled=[0|1] +# Enables or disables the 0xaa55 signature check on boot floppies +# Defaults to disabled=0 +# Examples: +# floppy_bootsig_check: disabled=0 +# floppy_bootsig_check: disabled=1 +#======================================================================= +#floppy_bootsig_check: disabled=0 + +#======================================================================= +# LOG: +# Give the path of the log file you'd like Bochs debug and misc. verbiage +# to be written to. If you don't use this option or set the filename to +# '-' the output is written to the console. If you really don't want it, +# make it "/dev/null" (Unix) or "nul" (win32). :^( +# +# Examples: +# log: ./bochs.out +# log: /dev/tty +#======================================================================= +#log: /dev/stdout +#log: ./bochs.log + +#======================================================================= +# LOGPREFIX: +# This handles the format of the string prepended to each log line. +# You may use those special tokens : +# %t : 11 decimal digits timer tick +# %i : 8 hexadecimal digits of cpu current eip (ignored in SMP configuration) +# %e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror) +# %d : 5 characters string of the device, between brackets +# +# Default : %t%e%d +# Examples: +# logprefix: %t-%e-@%i-%d +# logprefix: %i%e%d +#======================================================================= +#logprefix: %t%e%d + +#======================================================================= +# LOG CONTROLS +# +# Bochs now has four severity levels for event logging. +# panic: cannot proceed. If you choose to continue after a panic, +# don't be surprised if you get strange behavior or crashes. +# error: something went wrong, but it is probably safe to continue the +# simulation. +# info: interesting or useful messages. +# debug: messages useful only when debugging the code. This may +# spit out thousands per second. +# +# For events of each level, you can choose to crash, report, or ignore. +# TODO: allow choice based on the facility: e.g. crash on panics from +# everything except the cdrom, and only report those. +# +# If you are experiencing many panics, it can be helpful to change +# the panic action to report instead of fatal. However, be aware +# that anything executed after a panic is uncharted territory and can +# cause bochs to become unstable. The panic is a "graceful exit," so +# if you disable it you may get a spectacular disaster instead. +#======================================================================= +#panic: action=ask +#error: action=report +#info: action=report +#debug: action=report +#debug: action=report +#pass: action=fatal + +#======================================================================= +# DEBUGGER_LOG: +# Give the path of the log file you'd like Bochs to log debugger output. +# If you really don't want it, make it /dev/null or '-'. :^( +# +# Examples: +# debugger_log: ./debugger.out +#======================================================================= +#debugger_log: /dev/null +#debugger_log: debugger.out +#debugger_log: - + +#======================================================================= +# COM1, COM2, COM3, COM4: +# This defines a serial port (UART type 16550A). In the 'term' you can specify +# a device to use as com1. This can be a real serial line, or a pty. To use +# a pty (under X/Unix), create two windows (xterms, usually). One of them will +# run bochs, and the other will act as com1. Find out the tty the com1 +# window using the `tty' command, and use that as the `dev' parameter. +# Then do `sleep 1000000' in the com1 window to keep the shell from +# messing with things, and run bochs in the other window. Serial I/O to +# com1 (port 0x3f8) will all go to the other window. +# In socket* and pipe* (win32 only) modes Bochs becomes either socket/named pipe +# client or server. In client mode it connects to an already running server (if +# connection fails Bochs treats com port as not connected). In server mode it +# opens socket/named pipe and waits until a client application connects to it +# before starting simulation. This mode is useful for remote debugging (e.g. +# with gdb's "target remote host:port" command or windbg's command line option +# -k com:pipe,port=\\.\pipe\pipename). Note: 'socket' is a shorthand for +# 'socket-client' and 'pipe' for 'pipe-client'. Socket modes use simple TCP +# communication, pipe modes use duplex byte mode pipes. +# Other serial modes are 'null' (no input/output), 'file' (output to a file +# specified as the 'dev' parameter), 'raw' (use the real serial port - under +# construction for win32), 'mouse' (standard serial mouse - requires +# mouse option setting 'type=serial', 'type=serial_wheel' or 'type=serial_msys'). +# +# Examples: +# com1: enabled=1, mode=null +# com1: enabled=1, mode=mouse +# com2: enabled=1, mode=file, dev=serial.out +# com3: enabled=1, mode=raw, dev=com1 +# com3: enabled=1, mode=socket-client, dev=localhost:8888 +# com3: enabled=1, mode=socket-server, dev=localhost:8888 +# com4: enabled=1, mode=pipe-client, dev=\\.\pipe\mypipe +# com4: enabled=1, mode=pipe-server, dev=\\.\pipe\mypipe +#======================================================================= +# com1: enabled=1, mode=term, dev=/dev/ttyS0 + + +#======================================================================= +# PARPORT1, PARPORT2: +# This defines a parallel (printer) port. When turned on and an output file is +# defined the emulated printer port sends characters printed by the guest OS +# into the output file. On some platforms a device filename can be used to +# send the data to the real parallel port (e.g. "/dev/lp0" on Linux, "lpt1" on +# win32 platforms). +# +# Examples: +# parport1: enabled=1, file="parport.out" +# parport2: enabled=1, file="/dev/lp0" +# parport1: enabled=0 +#======================================================================= +# parport1: enabled=1, file="/dev/lp0" + +#======================================================================= +# SB16: +# This defines the SB16 sound emulation. It can have several of the +# following properties. +# All properties are in the format sb16: property=value +# midi: The filename is where the midi data is sent. This can be a +# device or just a file if you want to record the midi data. +# midimode: +# 0=no data +# 1=output to device (system dependent. midi denotes the device driver) +# 2=SMF file output, including headers +# 3=output the midi data stream to the file (no midi headers and no +# delta times, just command and data bytes) +# wave: This is the device/file where wave output is stored +# wavemode: +# 0=no data +# 1=output to device (system dependent. wave denotes the device driver) +# 2=VOC file output, incl. headers +# 3=output the raw wave stream to the file +# log: The file to write the sb16 emulator messages to. +# loglevel: +# 0=no log +# 1=resource changes, midi program and bank changes +# 2=severe errors +# 3=all errors +# 4=all errors plus all port accesses +# 5=all errors and port accesses plus a lot of extra info +# dmatimer: +# microseconds per second for a DMA cycle. Make it smaller to fix +# non-continuous sound. 750000 is usually a good value. This needs a +# reasonably correct setting for the IPS parameter of the CPU option. +# +# Examples for output devices: +# sb16: midimode=1, midi="", wavemode=1, wave="" # win32 +# sb16: midimode=1, midi=alsa:128:0, wavemode=1, wave=alsa # Linux with ALSA +#======================================================================= +#sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=/dev/stdout, dmatimer=600000 + +#======================================================================= +# VGA_UPDATE_INTERVAL: +# Video memory is scanned for updates and screen updated every so many +# virtual seconds. The default is 50000, about 20Hz. Keep in mind that +# you must tweak the 'cpu: ips=N' directive to be as close to the number +# of emulated instructions-per-second your workstation can do, for this +# to be accurate. +# +# Examples: +# vga_update_interval: 250000 +#======================================================================= +#vga_update_interval: 300000 +#vga_update_interval: 40000 + +# using for Winstone '98 tests +#vga_update_interval: 100000 + +#======================================================================= +# KEYBOARD_SERIAL_DELAY: +# Approximate time in microseconds that it takes one character to +# be transfered from the keyboard to controller over the serial path. +# Examples: +# keyboard_serial_delay: 200 +#======================================================================= +#keyboard_serial_delay: 250 + +#======================================================================= +# KEYBOARD_PASTE_DELAY: +# Approximate time in microseconds between attempts to paste +# characters to the keyboard controller. This leaves time for the +# guest os to deal with the flow of characters. The ideal setting +# depends on how your operating system processes characters. The +# default of 100000 usec (.1 seconds) was chosen because it works +# consistently in Windows. +# +# If your OS is losing characters during a paste, increase the paste +# delay until it stops losing characters. +# +# Examples: +# keyboard_paste_delay: 100000 +#======================================================================= +#keyboard_paste_delay: 100000 + +#======================================================================= +# MOUSE: +# This defines parameters for the emulated mouse type, the initial status +# of the mouse capture and the runtime method to toggle it. +# +# TYPE: +# With the mouse type option you can select the type of mouse to emulate. +# The default value is 'ps2'. The other choices are 'imps2' (wheel mouse +# on PS/2), 'serial', 'serial_wheel' and 'serial_msys' (one com port requires +# setting 'mode=mouse'). To connect a mouse to an USB port, see the 'usb_uhci' +# or 'usb_ohci' option (requires PCI and USB support). +# +# ENABLED: +# The Bochs gui creates mouse "events" unless the 'enabled' option is +# set to 0. The hardware emulation itself is not disabled by this. +# Unless you have a particular reason for enabling the mouse by default, +# it is recommended that you leave it off. You can also toggle the mouse +# usage at runtime (RFB, SDL, Win32, wxWidgets and X11 - see below). +# +# TOGGLE: +# The default method to toggle the mouse capture at runtime is to press the +# CTRL key and the middle mouse button ('ctrl+mbutton'). This option allows +# to change the method to 'ctrl+f10' (like DOSBox), 'ctrl+alt' (like QEMU) +# or 'f12' (replaces win32 'legacyF12' option). +# +# Examples: +# mouse: enabled=1 +# mouse: type=imps2, enabled=1 +# mouse: type=serial, enabled=1 +# mouse: enabled=0, toggle=ctrl+f10 +#======================================================================= +#mouse: enabled=1 + +#======================================================================= +# private_colormap: Request that the GUI create and use it's own +# non-shared colormap. This colormap will be used +# when in the bochs window. If not enabled, a +# shared colormap scheme may be used. Not implemented +# on all GUI's. +# +# Examples: +# private_colormap: enabled=1 +# private_colormap: enabled=0 +#======================================================================= +#private_colormap: enabled=0 + +#======================================================================= +# ne2k: NE2000 compatible ethernet adapter +# +# Examples: +# ne2k: ioaddr=IOADDR, irq=IRQ, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT +# +# ioaddr, irq: You probably won't need to change ioaddr and irq, unless there +# are IRQ conflicts. These arguments are ignored when assign the ne2k to a +# PCI slot. +# +# mac: The MAC address MUST NOT match the address of any machine on the net. +# Also, the first byte must be an even number (bit 0 set means a multicast +# address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast +# address. For the ethertap module, you must use fe:fd:00:00:00:01. There may +# be other restrictions too. To be safe, just use the b0:c4... address. +# +# ethdev: The ethdev value is the name of the network interface on your host +# platform. On UNIX machines, you can get the name by running ifconfig. On +# Windows machines, you must run niclist to get the name of the ethdev. +# Niclist source code is in misc/niclist.c and it is included in Windows +# binary releases. +# +# script: The script value is optional, and is the name of a script that +# is executed after bochs initialize the network interface. You can use +# this script to configure this network interface, or enable masquerading. +# This is mainly useful for the tun/tap devices that only exist during +# Bochs execution. The network interface name is supplied to the script +# as first parameter +# +# If you don't want to make connections to any physical networks, +# you can use the following 'ethmod's to simulate a virtual network. +# null: All packets are discarded, but logged to a few files. +# arpback: ARP is simulated. Disabled by default. +# vde: Virtual Distributed Ethernet +# vnet: ARP, ICMP-echo(ping), DHCP and read/write TFTP are simulated. +# The virtual host uses 192.168.10.1. +# DHCP assigns 192.168.10.2 to the guest. +# TFTP uses the ethdev value for the root directory and doesn't +# overwrite files. +# +#======================================================================= +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0 +# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0 +# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=null, ethdev=eth0 +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl" +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp" + +#======================================================================= +# pnic: Bochs/Etherboot pseudo-NIC +# +# Example: +# pnic: enabled=1, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT +# +# The pseudo-NIC accepts the same syntax (for mac, ethmod, ethdev, script) and +# supports the same networking modules as the NE2000 adapter. In addition to +# this, it must be assigned to a PCI slot. +#======================================================================= +#pnic: enabled=1, mac=b0:c4:20:00:00:00, ethmod=vnet + +#======================================================================= +# KEYBOARD_MAPPING: +# This enables a remap of a physical localized keyboard to a +# virtualized us keyboard, as the PC architecture expects. +# If enabled, the keymap file must be specified. +# +# Examples: +# keyboard_mapping: enabled=1, map=gui/keymaps/x11-pc-de.map +#======================================================================= +#keyboard_mapping: enabled=0, map=/usr/share/bochs/keymaps/x11-pc-de.map + +#======================================================================= +# KEYBOARD_TYPE: +# Type of keyboard return by a "identify keyboard" command to the +# keyboard controler. It must be one of "xt", "at" or "mf". +# Defaults to "mf". It should be ok for almost everybody. A known +# exception is french macs, that do have a "at"-like keyboard. +# +# Examples: +# keyboard_type: mf +#======================================================================= +#keyboard_type: mf + +#======================================================================= +# USER_SHORTCUT: +# This defines the keyboard shortcut to be sent when you press the "user" +# button in the headerbar. The shortcut string is a combination of maximum +# 3 key names (listed below) separated with a '-' character. +# Valid key names: +# "alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc", +# "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", +# "plus", "right", "shift", "space", "tab", "up", "win", "print" and "power". +# +# Example: +# user_shortcut: keys=ctrl-alt-del +#======================================================================= +#user_shortcut: keys=ctrl-alt-del + +#======================================================================= +# I440FXSUPPORT: +# This option controls the presence of the i440FX PCI chipset. You can +# also specify the devices connected to PCI slots. Up to 5 slots are +# available now. These devices are currently supported: ne2k, pcivga, +# pcidev, pcipnic and usb_ohci. If Bochs is compiled with Cirrus SVGA +# support you'll have the additional choice 'cirrus'. +# +# Example: +# i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k +#======================================================================= +#i440fxsupport: enabled=1 + +#======================================================================= +# USB_UHCI: +# This option controls the presence of the USB root hub which is a part +# of the i440FX PCI chipset. With the portX parameter you can connect devices +# to the hub (currently supported: 'mouse', 'tablet', 'keypad', 'disk', 'cdrom' +# 'hub' and 'printer'). +# +# The optionsX parameter can be used to assign specific options to the device +# connected to the corresponding USB port. Currently this feature is only used +# to set the speed reported by device and by the 'disk' device to specify +# an alternative redolog file of some image modes. +# +# If you connect the mouse or tablet to one of the ports, Bochs forwards the +# mouse movement data to the USB device instead of the selected mouse type. +# When connecting the keypad to one of the ports, Bochs forwards the input of +# the numeric keypad to the USB device instead of the PS/2 keyboard. +# +# To connect a 'flat' mode image as an USB hardisk you can use the 'disk' device +# with the path to the image separated with a colon. To use other disk image modes +# similar to ATA disks the syntax 'disk:mode:filename' must be used (see below). +# +# To emulate an USB cdrom you can use the 'cdrom' device name and the path to +# an ISO image or raw device name also separated with a colon. An option to +# insert/eject media is available in the runtime configuration. +# +# The device name 'hub' connects an external hub with max. 8 ports (default: 4) +# to the root hub. To specify the number of ports you have to add the value +# separated with a colon. Connecting devices to the external hub ports is only +# available in the runtime configuration. +# +# The device 'printer' emulates the HP Deskjet 920C printer. The PCL data is +# sent to a file specified in bochsrc.txt. The current code appends the PCL +# code to the file if the file already existed. It would probably be nice to +# overwrite the file instead, asking user first. +#======================================================================= +#usb_uhci: enabled=1 +#usb_uhci: enabled=1, port1=mouse, port2=disk:usbstick.img +#usb_uhci: enabled=1, port1=hub:7, port2=disk:growing:usbdisk.img +#usb_uhci: enabled=1, port2=disk:undoable:usbdisk.img, options1=journal:redo.log +#usb_uhci: enabled=1, port1=printer:printdata.bin, port2=cdrom:image.iso + +#======================================================================= +# USB_OHCI: +# This option controls the presence of the USB OHCI host controller with a +# 2-port hub. The portX option accepts the same device types with the same +# syntax as the UHCI controller (see above). The OHCI HC must be assigned to +# a PCI slot. +#======================================================================= +#usb_ohci: enabled=1 +#usb_ohci: enabled=1, port1=printer:usbprinter.bin + +#======================================================================= +# CMOSIMAGE: +# This defines image file that can be loaded into the CMOS RAM at startup. +# The rtc_init parameter controls whether initialize the RTC with values stored +# in the image. By default the time0 argument given to the clock option is used. +# With 'rtc_init=image' the image is the source for the initial time. +# +# Example: +# cmosimage: file=cmos.img, rtc_init=image +#======================================================================= +#cmosimage: file=cmos.img, rtc_init=time0 + +#======================================================================= +# MAGIC_BREAK: +# This enables the "magic breakpoint" feature when using the debugger. +# The useless cpu instruction XCHG BX, BX causes Bochs to enter the +# debugger mode. This might be useful for software development. +# +# Example: +# magic_break: enabled=1 +#======================================================================= +#magic_break: enabled=1 + +#======================================================================= +# PORT_E9_HACK: +# The 0xE9 port doesn't exists in normal ISA architecture. However, we +# define a convention here, to display on the console of the system running +# Bochs anything that is written to it. The idea is to provide debug output +# very early when writing BIOS or OS code for example, without having to +# bother with setting up a serial port or etc. Reading from port 0xE9 will +# will return 0xe9 to let you know if the feature is available. +# Leave this 0 unless you have a reason to use it. +# +# Example: +# port_e9_hack: enabled=1 +#======================================================================= +#port_e9_hack: enabled=1 + +#======================================================================= +# DEBUG_SYMBOLS: +# This loads symbols from the specified file for use in Bochs' internal +# debugger. Symbols are loaded into global context. This is equivalent to +# issuing ldsym debugger command at start up. +# +# Example: +# debug_symbols: file="kernel.sym" +# debug_symbols: file="kernel.sym", offset=0x80000000 +#======================================================================= +#debug_symbols: file="kernel.sym" + +#======================================================================= +# other stuff +#======================================================================= +#load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log +#load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img +#text_snapshot_check: enabled=1 +#print_timestamps: enabled=1 + +#------------------------- +# PCI host device mapping +#------------------------- +#pcidev: vendor=0x1234, device=0x5678 + +#======================================================================= +# GDBSTUB: +# Enable GDB stub. See user documentation for details. +# Default value is enabled=0. +#======================================================================= +#gdbstub: enabled=0, port=1234, text_base=0, data_base=0, bss_base=0 + +#======================================================================= +# PLUGIN_CTRL: +# Controls the presence of optional plugins without a separate option. +# By default all existing plugins are enabled. These plugins are currently +# supported: 'acpi', 'biosdev', 'extfpuirq', 'gameport', 'iodebug', +# 'pci_ide', 'speaker' and 'unmapped'. +#======================================================================= +#plugin_ctrl: biosdev=0, speaker=0 + +#======================================================================= +# USER_PLUGIN: +# Load user-defined plugin. This option is available only if Bochs is +# compiled with plugin support. Maximum 8 different plugins are supported. +# See the example in the Bochs sources how to write a plugin device. +#======================================================================= +#user_plugin: name=testdev +# +# +# +## +#pci: enabled=1, chipset=i440fx, slot1=cirrus +#i440fxsupport: enabled=1, slot1=cirrus +#e1000: enabled=1, mac=52:54:00:12:34:56 #, ethmod=slirp, script=slirp.conf + + diff --git a/xxx/font/Makefile b/xxx/font/Makefile new file mode 100644 index 0000000..2eeaf37 --- /dev/null +++ b/xxx/font/Makefile @@ -0,0 +1,5 @@ +############ fool-font ############ +binfont.bin: binfont.src + python3.2 binarize.py $< $@ +clean: + -rm binfont.bin diff --git a/xxx/font/binarize.py b/xxx/font/binarize.py new file mode 100644 index 0000000..1abb9d6 --- /dev/null +++ b/xxx/font/binarize.py @@ -0,0 +1,87 @@ +import sys + +def binarize(file_in, file_out): + + """ Create a binary file from an ASCII file. Everything + but '0' and '1' (alternatively '_' and 'X') is ignored + from the input file. """ + + print ("binarizing " + file_in + " to "+ file_out + ".") + + try: + + f=open(file_in,'r') + + try: + + o=open(file_out,'wb') + + try: + + while True: + + b=readnext(f) + if b==-1: + break + + o.write(bytes([b])) + + except IOError: + print("IOError happened during processing."); + print("I am closing the input and ouput files and aborting."); + print("Warning: The output file is very likely incomplete."); + + o.close() + + except IOError: + print("IOError opening output file: " + file_out); + + f.close() + + except IOError: + print("IOError opening input file: " + file_in); + + +def readnext(f): + + """ Read next 'byte' from the given ASCII file (BufferedWriter) + everything but '_','X','0','1' is ignored. + Returns the byte as integer or -1 on EOF """ + + l=0 + b="" + + while l<8: + + c=f.read(1) + + if not c: + return -1 + + if c=="0" or c=='_': + l+=1 + b+="0" + + if c=="1" or c=='X': + l+=1 + b+="1" + + return int(b,2) + +def usage(): + + """ Prints usage information to sdtout """ + + print ("python3.x binarize.py [file_in] [file_out]") + + + +""" direct use """ + +if __name__ == "__main__": + + if(len(sys.argv)==3): + binarize(sys.argv[1],sys.argv[2]) + else: + usage() + diff --git a/xxx/font/binfont.src b/xxx/font/binfont.src new file mode 100644 index 0000000..c1d9ccc --- /dev/null +++ b/xxx/font/binfont.src @@ -0,0 +1,1235 @@ + +// space (ox2o) + +________ +________ +________ +________ +________ +________ +________ +________ +________ +________ + +// ! + +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +________ +________ +___XX___ +___XX___ + +// " + +_XX__XX_ +_XX__XX_ +_XX__XX_ +________ +________ +________ +________ +________ +________ +________ + +// # + +________ +__X__X__ +__X__X__ +XXXXXXXX +__X__X__ +__X__X__ +__X__X__ +XXXXXXXX +__X__X__ +__X__X__ + +// $ + +________ +___X____ +_XXXXXX_ +XX_X__XX +_XXX____ +__XXXX__ +___X_XX_ +XX_X__XX +_XXXXXX_ +___X____ + +// % + +______XX +_X___XX_ +X_X_XX__ +_X__XX__ +___XX___ +___XX___ +__XX__X_ +__XX_X_X +_XX___X_ +XX______ + +// & + +__X_____ +_X_X____ +X___X___ +_X_X____ +__XX____ +_X_X____ +X___X_X_ +X____X__ +X___X_X_ +_XXX___X + +// ' + +___XX___ +___XX___ +___XX___ +________ +________ +________ +________ +________ +________ +________ + +// ( + +___X____ +__X_____ +_X______ +_X______ +X_______ +X_______ +_X______ +_X______ +__X_____ +___X____ + +// ) + +___X____ +_____X__ +______X_ +______X_ +_______X +_______X +______X_ +______X_ +_____X__ +___X____ + +// * + +________ +________ +X__X__X_ +_X_X_X__ +__XXX___ +XXXXXXX_ +__XXX___ +_X_X_X__ +X__X__X_ +________ + +// + + +________ +________ +___XX___ +___XX___ +XXXXXXXX +XXXXXXXX +___XX___ +___XX___ +________ +________ + +// , + +________ +________ +________ +________ +________ +________ +________ +___XX___ +___XX___ +__XX____ + +// - + +________ +________ +________ +________ +_XXXXXX_ +_XXXXXX_ +________ +________ +________ +________ + +// . + +________ +________ +________ +________ +________ +________ +________ +________ +___XX___ +___XX___ + +// / +______XX +_____XX_ +____XX__ +____XX__ +___XX___ +___XX___ +__XX____ +__XX____ +_XX_____ +XX______ + +// zero + +_XXXXXX_ +XXXXXXXX +XX___XXX +XX__X_XX +XX__X_XX +XX_X__XX +XX_X__XX +XXX___XX +XXXXXXXX +_XXXXXX_ + +// one + +___XX___ +__XXX___ +__XXX___ +_XXXX___ +XX_XX___ +___XX___ +___XX___ +___XX___ +___XX___ +_XXXXXX_ + +// 2 + +_XXXXXX_ +XXXXXXXX +_____XXX +_____XXX +____XXX_ +___XXX__ +_XXX____ +XXX_____ +XXXXXXXX +XXXXXXXX + +// 3 + +XXXXXXXX +XXXXXXXX +_____XXX +____XX__ +___XX___ +__XXX___ +____XXX_ +XX___XXX +XXXXXXXX +_XXXXXX_ + +// 4 + +___XX___ +__XXX___ +__XXX___ +_XXXX___ +XX_XX___ +XXXXXXXX +XXXXXXXX +___XX___ +___XX___ +___XX___ + +// 5 + +XXXXXXXX +XXXXXXXX +XXX_____ +XXX_____ +XXXXXXX_ +_XXXXXXX +______XX +X_____XX +XXXXXXXX +_XXXXXX_ + +// 6 + +_XXXXXX_ +XXXXXXXX +XX______ +XX______ +XXXXXXX_ +XXXXXXX_ +XX____XX +XX____XX +XXXXXXXX +_XXXXXX_ + +// 7 + +XXXXXXXX +XXXXXXXX +_____XXX +____XXX_ +____XXX_ +___XXX__ +___XXX__ +__XXX___ +__XXX___ +_XXX____ + +// 8 + +_XXXXXX_ +XXXXXXXX +XX____XX +XX____XX +_XXXXXX_ +_XXXXXX_ +XX____XX +XX____XX +XXXXXXXX +_XXXXXX_ + +// 9 + +_XXXXXX_ +XXXXXXXX +XX____XX +XX____XX +_XXXXXXX +_XXXXXXX +______XX +______XX +XXXXXXXX +_XXXXXX_ + + +// : + +________ +________ +________ +________ +___XX___ +___XX___ +________ +___XX___ +___XX___ +________ + + +// ; + +________ +________ +________ +________ +___XX___ +___XX___ +________ +___XX___ +___XX___ +__XX____ + +// < + +________ +________ +______XX +____XX__ +__XX____ +XX______ +__XX____ +____XX__ +______XX +________ + +// = + +________ +________ +________ +________ +XXXXXXXX +________ +XXXXXXXX +________ +________ +________ + + +// > + +________ +________ +XX______ +__XX____ +____XX__ +______XX +____XX__ +__XX____ +XX______ +________ + +// ? + + +_XXXXXX_ +XXXXXXXX +XX____XX +_X___XX_ +____XX__ +___XX___ +___XX___ +________ +___XX___ +___XX___ + +// @ + +_XXXXXX_ +XXXXXXXX +XX____XX +XX_XXXXX +XX_X__XX +XX_X__XX +XX_XXXXX +XX______ +XXXXXXXX +_XXXXXXX + + +// A + +XXXXXXXX +XXXXXXXX +XX____XX +XX____XX +XXXXXXXX +XXXXXXXX +XX____XX +XX____XX +XX____XX +XX____XX + +// B + +XXXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XXXXXXX_ +XXXXXXX_ +XX____XX +XX____XX +XXXXXXXX +XXXXXXX_ + +// C + +XXXXXXXX +XXXXXXXX +XX______ +XX______ +XX______ +XX______ +XX______ +XX______ +XXXXXXXX +XXXXXXXX + +// D + +XXXXXX__ +XXXXXXX_ +XX___XXX +XX____XX +XX____XX +XX____XX +XX____XX +XX___XXX +XXXXXXX_ +XXXXXX__ + +// E + +XXXXXXXX +XXXXXXXX +XX______ +XX______ +XXXXXXX_ +XXXXXXX_ +XX______ +XX______ +XXXXXXXX +XXXXXXXX + +// F + +XXXXXXXX +XXXXXXXX +XX______ +XX______ +XXXXXXX_ +XXXXXXX_ +XX______ +XX______ +XX______ +XX______ + +// G + +XXXXXXXX +XXXXXXXX +XX______ +XX______ +XX__XXXX +XX__XXXX +XX____XX +XX____XX +XXXXXXXX +XXXXXXXX + +// H + +XX____XX +XX____XX +XX____XX +XX____XX +XXXXXXXX +XXXXXXXX +XX____XX +XX____XX +XX____XX +XX____XX + +// I + +_XXXXXX_ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +_XXXXXX_ + +// J + +XXXXXXXX +XXXXXXXX +______XX +______XX +______XX +______XX +XX____XX +XXX___XX +_XXXXXXX +__XXXXXX + +// K + +XX____XX +XX__XXX_ +XX__XXX_ +XX_XXX__ +XXXX____ +XXXX____ +XX_XXX__ +XX__XXX_ +XX__XXX_ +XX____XX + +// L + +XX______ +XX______ +XX______ +XX______ +XX______ +XX______ +XX______ +XX______ +XXXXXXXX +XXXXXXXX + +// M + +XX____XX +XXX__XXX +XXX_XXXX +XXXXXXXX +XXXXXXXX +XX_XX_XX +XX_XX_XX +XX____XX +XX____XX +XX____XX + +// N + +XX____XX +XXX___XX +XXX___XX +XXXX__XX +XXXXX_XX +XX_XXXXX +XX__XXXX +XX___XXX +XX___XXX +XX____XX + +// O + +_XXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XX____XX +XX____XX +XX____XX +XX____XX +XXXXXXXX +_XXXXXX_ + +// P + +XXXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XXXXXXXX +XXXXXXX_ +XX______ +XX______ +XX______ +XX______ + +// Q + +_XXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XX____XX +XX_XX_XX +XX_XXXXX +XX__XXXX +XXXXXXXX +_XXXXXXX + +// R + +XXXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XXXXXXXX +XXXXXXX_ +XXXXX___ +XX_XXX__ +XX__XXX_ +XX___XXX + +// S + +_XXXXXX_ +XXXXXXXX +XX____XX +_XX___X_ +__XX____ +___XXX__ +_X__XXX_ +XX___XXX +XXXXXXXX +_XXXXXX_ + +// T + +XXXXXXXX +XXXXXXXX +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ + +// U + +XX____XX +XX____XX +XX____XX +XX____XX +XX____XX +XX____XX +XX____XX +XX____XX +XXXXXXXX +_XXXXXX_ + +// V + +XX____XX +XX____XX +XX____XX +_XX__XX_ +_XX__XX_ +_XX__XX_ +__XXXX__ +__XXXX__ +___XX___ +___XX___ + +// W + +XX____XX +XX____XX +XX_XX_XX +XX_XX_XX +XXXXXXXX +XXXXXXXX +XXX__XXX +XXX__XXX +XX____XX +XX____XX + +// x big + +XX____XX +XX____XX +_XX__XX_ +_XX__XX_ +__XXXX__ +__XXXX__ +_XX__XX_ +_XX__XX_ +XX____XX +XX____XX + +// Y + +XX____XX +XX____XX +_XX__XX_ +_XX__XX_ +__XXXX__ +__XXXX__ +___XX___ +___XX___ +___XX___ +___XX___ + +// Z + +XXXXXXXX +XXXXXXXX +_____XXX +_____XXX +____XXX_ +___XXX__ +_XXX____ +XXX_____ +XXXXXXXX +XXXXXXXX + +// [ + +XXXX____ +XXXX____ +XX______ +XX______ +XX______ +XX______ +XX______ +XX______ +XXXX____ +XXXX____ +// \ + +XX______ +_XX_____ +__XX____ +__XX____ +___XX___ +___XX___ +____XX__ +____XX__ +_____XX_ +______XX + +// ] + +____XXXX +____XXXX +______XX +______XX +______XX +______XX +______XX +______XX +____XXXX +____XXXX +// ^ + +___XX___ +__XXXX__ +_XX__XX_ +XX____XX +________ +________ +________ +________ +________ +________ + +// underscore + +________ +________ +________ +________ +________ +________ +________ +________ +XXXXXXXX +XXXXXXXX + +// ` + +__XX____ +___XX___ +____XX__ +________ +________ +________ +________ +________ +________ +________ + +// a +________ +________ +_XXXXXX_ +XXXXXXXX +______XX +_XXXXXXX +XXXXXXXX +XX____XX +XXXXXXXX +_XXXX_XX + +// b + +XX______ +XX______ +XX______ +XX______ +XXXXXXX_ +XXXXXXX_ +XX____XX +XX____XX +XXXXXXX_ +XXXXXXX_ + +// c + +________ +________ +________ +_XXXXXX_ +XXXXXXXX +XX______ +XX______ +XX______ +XXXXXXXX +_XXXXXX_ + +// d + +______XX +______XX +______XX +______XX +_XXXXXXX +_XXXXXXX +XX____XX +XX____XX +_XXXXXXX +_XXXXXXX + +// e + +________ +________ +_XXXXXX_ +XXXXXXXX +XX_____X +XXXXXXX_ +XX______ +XX______ +XXXXXXXX +_XXXXXX_ + +// f + +_XXXXXX_ +XXXXXXXX +XX______ +XX______ +XXXXXXX_ +XXXXXXX_ +XX______ +XX______ +XX______ +XX______ + +// g + +________ +________ +_XXXXXXX +_XXXXXXX +XX____XX +XX____XX +_XXXXXXX +______XX +XX____XX +_XXXXXXX + +// h + +XX______ +XX______ +XX______ +XX______ +XXXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XX____XX +XX____XX + + +// i + +________ +________ +________ +___XX___ +________ +___XX___ +___XX___ +___XX___ +___XX___ +__XXXX__ + + +// j + +________ +________ +____XX__ +________ +____XX__ +____XX__ +____XX__ +_XX_XX__ +_XX_XX__ +__XXX___ + +// k + + +XX______ +XX______ +XX______ +XX______ +XX____XX +XX__XXX_ +XXXXXX__ +XX_XXX__ +XX__XXX_ +XX___XXX + +// l + + +_XXXX___ +_XXXX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +_XXXXXX_ + + +// m +________ +________ +________ +XX______ +XXXX_XX_ +XXXXXXXX +XX_XX_XX +XX_XX_XX +XX_XX_XX +XX_XX_XX + +// n +________ +________ +________ +XX______ +XXXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XX____XX +XX____XX + +// o +________ +________ +________ +_XXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XX____XX +XXXXXXXX +_XXXXXX_ + +// p +________ +________ +_XXXXXX_ +XXXXXXXX +XX____XX +XX____XX +XXXXXXX_ +XX______ +XX______ +XX______ + +// q + +________ +________ +_XXXXXX_ +XXXXXXXX +XX____XX +XX____XX +_XXXXXXX +______XX +______XX +______XX + +// r +________ +________ +________ +XX__XX__ +XX_XXXX_ +XXXX__XX +XX______ +XX______ +XX______ +XX______ + +// s + +________ +________ +________ +_XXXXXX_ +XX____XX +_XX_____ +__XXXX__ +_____XX_ +XX____XX +_XXXXXX_ + +// t + +__XX____ +__XX____ +XXXXXX__ +XXXXXX__ +__XX____ +__XX____ +__XX____ +__XX__X_ +__XX_XX_ +___XXX__ + +// u +________ +________ +________ +________ +XX____XX +XX____XX +XX____XX +XX____XX +XX____XX +_XXXXXX_ + +// v +________ +________ +________ +________ +XX____XX +XX____XX +_XX__XX_ +_XX__XX_ +__XXXX__ +___XX___ + +// w +________ +________ +________ +________ +XX_XX_XX +XX_XX_XX +XX_XX_XX +XX_XX_XX +XXXXXXXX +_XX__XX_ + + +// x + +________ +________ +________ +XX____XX +_XX__XX_ +_XX__XX_ +__XXXX__ +_XX__XX_ +_XX__XX_ +XX____XX + + +// y + +________ +________ +________ +XX____XX +_XX__XX_ +_XX__XX_ +__XXXX__ +___XX___ +__XX____ +_XX_____ + + +// z +________ +________ +________ +________ +XXXXXXXX +_____XX_ +____XX__ +__XXX___ +_XX_____ +XXXXXXXX + +// { + +____XX__ +___X____ +__X_____ +__X_____ +XX______ +XX______ +__X_____ +__X_____ +___X____ +____XX__ + +// | + +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ +___XX___ + +// } + +__XX____ +____X___ +_____X__ +_____X__ +______XX +______XX +_____X__ +_____X__ +____X___ +__XX____ + +// ~ + +________ +________ +________ +_XX_____ +X__XX__X +_____XX_ +________ +________ +________ +________ diff --git a/xxx/inactive/console.c b/xxx/inactive/console.c new file mode 100644 index 0000000..dc9b90e --- /dev/null +++ b/xxx/inactive/console.c @@ -0,0 +1,59 @@ +/* +// http://invisible-island.net/xterm/ctlseqs/ctlseqs.html +// http://invisible-island.net/vttest/ +// http://www.xfree86.org/4.7.0/ctlseqs.html + + +#include "kernel/config.h" +#include "lib/logger/log.h" +#include "fs/ext2.h" + + +#define FOOLOS_MODULE_NAME "console" + +#ifdef FOOLOS_CONSOLE + +#include "video/console.h" + +uint32_t console_init(){ + scr_clear(); + return 0; +} + +void console_del_char(){scr_backspace();} +void console_put_char_gray(char c){scr_put_char(c,SCR_GRAY2);} +void console_put_char_white(char c){scr_put_char(c,SCR_WHITE);} +void console_put_char_green(char c){scr_put_char(c,SCR_GREEN);} +void console_put_char_red(char c){scr_put_char(c,SCR_RED);} + +void console_put_str_gray(char *s){scr_put_string(s,SCR_GRAY2);} +void console_put_str_white(char *s){scr_put_string(s,SCR_WHITE);} +void console_put_str_green(char *s){scr_put_string(s,SCR_GREEN);} +void console_put_str_red(char *s){scr_put_string(s,SCR_RED);} +#else + +#include "video/vesa.h" + +uint32_t console_init(uint32_t mode, uint32_t control){ + + int inode_nr=ext2_filename_to_inode(EXT2_RAM_ADDRESS,"/binfont.bin"); + ext2_inode_content(EXT2_RAM_ADDRESS,inode_nr,0x700000,0xffff); // load font; + //uint32_t vesa_physbase=vesa_init(0xb000,0xc000,0x700000); + uint32_t vesa_physbase=vesa_init(mode,control,0x700000); + return vesa_physbase; +} + +void console_del_char(char c){PutConsoleChar('*',0xffffff);} +void console_put_char(char c){PutConsoleChar(c,0xffffff);} +void console_put_char_gray(char c){PutConsoleChar(c,0xffffff);} +void console_put_char_white(char c){PutConsoleChar(c,0xffffff);} +void console_put_char_green(char c){PutConsoleChar(c,0xffffff);} +void console_put_char_red(char c){PutConsoleChar(c,0xffffff);} +void console_put_str(char *s){PutConsole(s,0xffffff);} +void console_put_str_gray(char *s){PutConsole(s,0xffffff);} +void console_put_str_white(char *s){PutConsole(s,0xffffff);} +void console_put_str_green(char *s){PutConsole(s,0xffffff);} +void console_put_str_red(char *s){PutConsole(s,0xffffff);} + +#endif +*/ diff --git a/xxx/inactive/console.h b/xxx/inactive/console.h new file mode 100644 index 0000000..a153968 --- /dev/null +++ b/xxx/inactive/console.h @@ -0,0 +1,20 @@ +/* +#ifndef CONSOLE_H +#define CONSOLE_H + +#include + +uint32_t console_init(); +void console_put_char(uint8_t c,uint8_t color, uint32_t x, uint32_t y); +void console_put_char_white(char); +void console_put_char_red(char); +void console_put_char_green(char); +void console_put_char_gray(char); +void console_put_str_white(char *); +void console_put_str_red(char *); +void console_put_str_green(char *); +void console_put_str_gray(char *); +void console_del_char(); + +#endif +*/ -- cgit v1.2.3