Commit Graph

244 Commits

Author SHA1 Message Date
Kevin Lange
777b442a1e Finish rename of bochs driver to lfb driver.
* Removed some deprecated header stuff.
* Renamed functions / global variables.
2012-09-17 22:46:43 -07:00
Kevin Lange
5ce042f2d8 Deprecate VESA support.
This is in favor of bootloader-assisted mode switching. Grub has a
wonderful option we will exploit to set the video mode.

My laptop supports a couple of 32-bit video modes, which is nice,
because I'm not support 24-bit modes.

I'm not sure whether the super-sketchy video memory locator will work
in the real world, but we'll find out sometime soon.
2012-09-17 22:22:25 -07:00
Kevin Lange
07955c83c6 Fix dozens of build warnings and other oddities.
* Finally bring syscall.h up to speed and include all syscalls in the
  syscall module of the C library.
* Remove the third-party obfuscated C demos (we have nyancat, good
  enough)
* Fix userspace apps to build without complaining about undeclared
  strtok_r by disable __STRICT_ANSI__
* Fix .eh_frame by including the proper stuff with libgcc.
2012-09-04 20:27:49 -07:00
Kevin Lange
8ed06789ed New debug printing facilities.
- Can now register a userspace file descriptor as the output for kernel
  print statements through kprintf()
- Can set logging levels for debug print messages, which are separate
  from kernel log events and meant to be more readily visible. Log
  events are recorded in a buffer to be viewed later, though nothing
  actually using logging at the moment.
- Serial output is disabled by default now. You can enable it yourself
  by appending the logtoserial argument to the kernel on boot.
2012-09-03 22:35:11 -07:00
Kevin Lange
bba242dd62 Add a testing framework.
This is an automated system by which we boot qemu headless and use the
serial line to capture output from a testing application that is started
on bootup, running with the VGA terminal shell. This might be expanded
to boot to the graphical display within VNC and perform more advanced
tests with the Python shim using a VNC module for Python; we'll see.
2012-09-02 02:24:25 -07:00
Kevin Lange
444207cbd2 SIGCAT and fix alignment 2012-08-13 14:47:22 -07:00
Kevin Lange
f68ca25622 Boot-to-shell through kernel argument 'single' 2012-03-27 21:47:25 -05:00
Kevin Lange
816ddc8f3e Lots of process cleanup implemented; improved cursor rendering 2012-03-14 22:03:55 -05:00
Kevin Lange
2da22312a5 Merge branch 'master' of github.com:klange/osdev 2012-02-20 23:32:10 -06:00
Kevin Lange
de7a984938 Fix a bunch of bugs in signal handling and scheduling 2012-02-20 23:31:00 -06:00
Kevin Lange
531d70f933 Ugly fix to bootup stack fault bug 2012-02-16 15:51:26 -06:00
Kevin Lange
a72f9bc7cf Fix stack bug. 2012-02-16 14:31:40 -06:00
Markus Schober
6dc90b1ac2 shm_obtain takes a (size_t *) and modifies the value based on the true
size of the block returned.
2012-02-16 03:34:42 -06:00
Markus Schober
4453aba2de can haz threads? 2012-02-15 22:56:16 -06:00
Kevin Lange
cffbb02240 Stuff and things 2012-02-15 20:50:31 -06:00
Kevin Lange
de0bbe739b Fix a bunch of system calls... 2012-02-12 18:47:01 -06:00
Kevin Lange
89c7ef9620 Add signal header... 2012-02-11 18:02:22 -06:00
Markus Schober
45903b204b fixed a subtle bug in shm; added a bunch of utilities to test it 2012-02-10 22:31:38 -06:00
Kevin Lange
58c176dfa0 Syscalls to share file descriptors over a shared memory region 2012-02-08 20:59:34 -06:00
Kevin Lange
79fcaf5136 Stability fixes. 2012-02-08 20:09:28 -06:00
Kevin Lange
ea961ea0e3 Fix compilation warnings 2012-02-08 16:07:54 -06:00
Kevin Lange
65fa12f482 SIGNALS 2012-02-08 02:40:44 -06:00
Markus Schober
aec24c08f1 Attaching nearly works! 2012-02-07 02:29:28 -06:00
Kevin Lange
fdaf53b0c4 [shm] Working on negotiation functions 2012-02-05 19:56:21 -06:00
Kevin Lange
aba36f4dce Reserving syscall numbers for shared memory 2012-02-05 18:12:50 -06:00
Kevin Lange
c4e33117c0 mkdir and creat testing 2012-02-05 16:04:41 -06:00
Kevin Lange
6590b285b5 Mouse improvements (stability, scaling) 2012-02-04 22:29:46 -06:00
Kevin Lange
4366a20a8f Pipe and packet-based mouse device 2012-02-02 16:16:29 -06:00
Kevin Lange
89d9265c73 Actually deschedule processes when they are waiting 2012-01-31 19:27:38 -06:00
Kevin Lange
71298a5c83 Relatively broken local echo support 2012-01-31 00:16:09 -06:00
Kevin Lange
a8cc561cce Try to write good documentation for the vfs module 2012-01-30 16:48:54 -06:00
Kevin Lange
c9d5e735ed Getting ready for thread support 2012-01-28 17:06:07 -06:00
Markus Schober
405868ac8a First commit of readdir/ls support. 2012-01-27 04:04:04 -06:00
Kevin Lange
9061f91e74 stat(), fstat(), /bin/stat 2012-01-27 03:12:29 -06:00
Kevin Lange
ac8354d805 Add some system calls, plus a fakish /bin/login 2012-01-26 22:46:18 -06:00
Tianyi Wang
cbb739e14b [fix merge conflict] 2012-01-25 19:30:45 -06:00
Tianyi Wang
023865913c fs stuffs 2012-01-25 19:25:59 -06:00
Kevin Lange
339b82e10c [massive commit] Userspace terminal.
Completely removes:
* The kernel terminal (both VGA and graphical)
* The kernel ANSI parser (obviously)
* kgets() function
* Dozens of other functions that were made useless

Adds:
* Userspace terminal that should work (relatively) well
* Keyboard device driver (implemented with a "pipe" object)
* Stabalized interrupt interface
* `clear` uses the c library
* All panic screens and kprintf() output goes to the serial line ONLY
* The kernel boots directly into /bin/terminal (no arguments, unless you
  want to add them (such as -f))
2012-01-25 00:19:52 -06:00
Kevin Lange
d9c0c8efb6 Pipes, dup2, and an almost-kinda-working terminal 2012-01-24 19:06:07 -06:00
Kevin Lange
6c042aba53 Pipes 2012-01-24 18:40:25 -06:00
Kevin Lange
9147549bd5 oops 2012-01-24 17:58:19 -06:00
Kevin Lange
9ba44c73bc [pipe] Pipe (ring buffer) device? 2012-01-24 17:56:35 -06:00
Kevin Lange
e05515844d Null device 2012-01-23 23:01:23 -06:00
Kevin Lange
0440b775d8 [typo] 2012-01-18 20:08:43 -06:00
Kevin Lange
6b2ee875d4 Interrupts on/off is a semaphore 2012-01-10 19:54:05 -06:00
Kevin Lange
aa748bc99a Hmpf. 2012-01-10 19:14:30 -06:00
Kevin Lange
edebb12573 [misc] Boot logging to screen 2011-12-26 19:23:58 -06:00
Kevin Lange
c0f45e0b7f VESA mode switching support.
BIOS execution is provided through the `v8086` module, which provides
software emulation of an 8086 processor. It is not currently working
with some BIOSes and may (read: probably will be) replaced with another
emulator (x86emu comes to mind) at some point in the near future. In the
meantime, the default video mode for QEMU works with this and it's
enough to get us on real VESA instead of fake VBE. The `bochs` module
will be renamed in a future commit. Userspace programs have been
adjusted to work at bitrates other than 32 *POORLY*. If you write pixels
left-to-right, they should work fine. They only work with 24-bpp
otherwise, and then you need to be careful of what pixels you are
writing when, or you will overwrite things in other pixels.

You may pass a commandline argument like the following to set display
modes:

  vid=vesa,1024,768

Or for stranger modes under QEMU or Bochs, use the bochs VBE
initializer:

  vid=bochs,1280,720

Note that the address of the linear framebuffer is still found via
hackish probing instead of PCI or trusting the VBE information, so if
you have things in the wrong memory ranges (0xE0000000+), be prepared to
have them get read.

Once again, this entire commit is a massive hack. I am happy that it
worked, and I will continue to make it less hacky, but in the meantime,
this is what we've got.

Happy holidays.
2011-12-25 00:40:40 -06:00
Kevin Lange
fb8f35719d [vid] Prepare for VESA implementation. 2011-12-16 14:00:48 -06:00
Kevin Lange
bf1011e2ba [vid] Support setting video resolution from kernel args 2011-12-16 13:39:34 -06:00
Kevin Lange
a4d17cb382 Graphics resolution independence (targetting VESA support); update README 2011-12-16 13:16:20 -06:00
Kevin Lange
b2606ff706 [version] Kernel version and codename, shell uname cmd 2011-12-16 02:15:44 -06:00
Kevin Lange
fac669e4c3 [mem] Add facilities to track memory usage (naïvely) 2011-12-15 21:47:46 -06:00
Kevin Lange
021585e9ef [misc] Massive improvements to process handling
- Free process resources when a process exits (reaped in next process
  cycle; should probably reap after a wait() or something)
- Free process struct after wait()
- Fix page allocation
- Fix fork() return value for child process (attempted to write to an
  invalid point in kernel-stack memory)

We shouldn't be triple faulting randomly anymore!

Continue investigating the fork() return value, as there was a bugged
return at some point during executon of a test run of thrash-process.
2011-12-15 17:21:28 -06:00
Kevin Lange
37c3ab67ce [sys] Fix fork syscall return values 2011-12-15 15:31:18 -06:00
Kevin Lange
5d0f3f0f3d [text/io] Better text output management
- Fixes a number of bugs with VGA text-mode (including crashes and
  colors)
- Makes it far easier to include more console drivers in the kernel,
  though this will be terribly redundant in the future.
- Actually check for video graphics modes before attempting to draw the
  mouse cursor.
2011-12-14 21:50:34 -06:00
Kevin Lange
258e2bfbfe [log] More logging, make output of dmesg prettier 2011-12-14 19:43:14 -06:00
Kevin Lange
6d27ef0ffe [log] vsprintf, fix va logging 2011-12-14 19:19:51 -06:00
Kevin Lange
748a8e8d28 [log] Simple logging facility 2011-12-14 17:47:30 -06:00
Kevin Lange
2fdf993af7 [ide] Minor updates 2011-12-13 00:48:04 -06:00
Kevin Lange
61bdd8f11d [misc] Various, meaningless edits 2011-12-12 02:17:14 -06:00
Kevin Lange
16989b65b0 [locks] Locks 2011-12-10 19:15:12 -06:00
Kevin Lange
145c4274d5 [misc] Also the include files... 2011-12-10 17:45:04 -06:00
Kevin Lange
15c01ce442 [misc] Fix working directory handling 2011-12-08 15:37:11 -06:00
Kevin Lange
2a1b0d3dcf [process] Massive commit: New process model 2011-12-08 15:25:48 -06:00
Kevin Lange
3f513579e1 initial work on new process model 2011-12-07 20:59:08 -06:00
Kevin Lange
9f165800b7 [tree] Add some new functions 2011-12-07 20:58:47 -06:00
Kevin Lange
dca46fffc4 [sys] wait(pid) 2011-12-06 20:13:20 -06:00
Kevin Lange
fb2759e01a [mem] Add some new page fault special things 2011-12-06 19:43:45 -06:00
Kevin Lange
a9661400e2 [fs] Use the path canonicalization function for opening and cd'ing 2011-11-29 20:19:30 -06:00
Kevin Lange
80db0f331d [vfs] Proper path canonicalization available 2011-11-29 13:28:36 -06:00
Kevin Lange
05860ee7c7 [list] Fix remove and pop 2011-11-29 13:07:59 -06:00
Kevin Lange
63ae277053 [tree/list] Some additional functions 2011-11-29 06:52:26 -06:00
Kevin Lange
47a6832606 [tree] Simple tree implementation for processes 2011-11-29 02:49:19 -06:00
Kevin Lange
05b59d366f [list] Fix some bugs in that. It never works on the first push anyway, right? 2011-11-28 23:45:33 -06:00
Kevin Lange
ea7ddfe61d [list] Simple doubly-linked list implementation 2011-11-28 23:28:55 -06:00
Kevin Lange
010475b6ee [bochs] Add a function to force a redraw of the cursor 2011-11-26 17:18:20 -06:00
Kevin Lange
1b1cad3f4a [shell] Scroll through history 2011-11-26 16:14:35 -06:00
Kevin Lange
75329eed95 [misc] strstr, startswith 2011-11-26 15:25:59 -06:00
Kevin Lange
062e6fcd43 [shell] Tab completion, basic work on writing files 2011-11-24 18:59:23 -06:00
Kevin Lange
65e6b0e800 [shell] Redraw prompt on ^L 2011-11-23 21:22:25 -06:00
Kevin Lange
9fa8e10bce [ext2] Read from hard disk. Seems to work wonderfully. 2011-11-17 23:29:08 -06:00
Kevin Lange
20d89355dc [vfs] Working directories, I hope 2011-11-17 15:55:59 -06:00
Kevin Lange
eb98180d0e [pci] Add pci config read/write to system.h 2011-11-03 17:06:27 -05:00
Kevin Lange
49bea4b221 [shell] Do at least /some/ path canonicalization... 2011-11-01 18:51:15 -05:00
Kevin Lange
3b6e3745c1 Wallpapers 2011-10-31 17:41:16 -05:00
Kevin Lange
e604e4d655 [core] Some extra macros to make life easier 2011-10-31 01:17:26 -05:00
Kevin Lange
88b31af4b4 [mouse] Silly graphical pointer 2011-10-30 22:58:42 -05:00
Kevin Lange
bce5d78bed [mouse] block cursor 2011-10-30 19:11:04 -05:00
Kevin Lange
64a4d880be Add mouse_install to headers... 2011-10-29 20:33:24 -05:00
Kevin Lange
441acfa7c6 [mouse] Mouse drivers 2011-10-29 00:33:45 -05:00
Kevin Lange
a4e37ae963 [sys] Debugging tool 'STOP' 2011-10-26 19:11:05 -05:00
Kevin Lange
80656d9257 [ide] Missed the headerS 2011-10-25 23:33:14 -05:00
Kevin Lange
e83ca6c0b7 [hack] IDE disk reads to HDB
Run read-disk from the kernel shell to read the first sector of -hdb,
run write-disk to write the sequence "DCDCDCDCDC..." to the first
sector.
2011-10-25 21:39:55 -05:00
Kevin Lange
855eecbb41 [sys] Rearrange some things 2011-05-07 01:55:49 -05:00
Kevin Lange
36fd03a4ab [elf] Zero your bss, you fucking moron 2011-04-30 19:09:29 -05:00
Kevin Lange
f38360f5a7 Julia fractals, better direct keyboard handling. 2011-04-30 03:40:36 -05:00
Kevin Lange
9f49d915ba Oh my. 2011-04-29 21:41:29 -05:00
Kevin Lange
a3e8265030 oh god oh god it hurts 2011-04-29 19:54:07 -05:00
Kevin Lange
3c299a19ed [sys] sbrk, fix stacks? 2011-04-17 18:28:40 -05:00
Kevin Lange
eb0c5d05e1 [sys] Holy crap. 2011-04-17 17:44:29 -05:00
Kevin Lange
254ceb51ab [sys] More system calls, more stability, kill bad processes 2011-04-17 13:26:31 -05:00
Kevin Lange
ad7d5d7acc [sys] read/write/open/close, also cat 2011-04-16 20:01:04 -05:00
Kevin Lange
d2ff4c474e [ansi] Support for more escape sequences. 2011-04-15 21:48:20 -05:00
Kevin Lange
7cf04ad13e [elf] Separate exec and system 2011-04-15 17:33:19 -05:00
Kevin Lange
5c889a168d Non-shell tests 2011-04-12 15:48:00 -05:00
Kevin Lange
3b12812608 [sys] Move syscalls to a separate header 2011-04-11 16:45:15 -05:00
Kevin Lange
67901b3bf7 I definitely broke a bunch of stuff. 2011-04-08 17:53:52 -05:00
Kevin Lange
fabd941361 [task] Actually deschedule tasks that exit 2011-04-08 16:26:34 -05:00
Kevin Lange
e273784242 [elf] Execute simple static ELF binaries. 2011-04-08 15:27:12 -05:00
Kevin Lange
d31d763058 [util] Readelf utility, actually reading some elfs. Cool. 2011-04-07 01:24:21 -05:00
Kevin Lange
9b3c3a1e60 [bin] Working on ELF binaries. Redid some multiboot stuff (larger ramdisks should work now) 2011-04-06 16:50:37 -05:00
Kevin Lange
5404428b4a Significant terminal updates. Scrolling is faster, ansi support (limited), and some other things 2011-04-04 18:51:55 -05:00
Kevin Lange
cde56093d2 [panic] Updated panic screen 2011-03-30 02:16:30 -05:00
Kevin Lange
3f8a8e62ab [user] Still slightly broken userspace 2011-03-29 21:08:56 -05:00
Kevin Lange
9c85c544eb [fpu][bochs][sys] FPU enabled, line drawing function, abs(), max() 2011-03-29 16:35:02 -05:00
Kevin Lange
1ce1ab9aaf [mem] Enable direct mappings for memory, video now works with paging 2011-03-29 14:43:39 -05:00
Kevin Lange
a9365528b3 [binlits] Move binary literals to system include so we can use them anywhere 2011-03-29 13:49:15 -05:00
Kevin Lange
516490a711 [hacks] HACKS 2011-03-28 20:34:53 -05:00
Kevin Lange
9b1ab6e97f [bochs] Framebuffer terminal. PAGING HAS BEEN DISABLED 2011-03-28 19:34:44 -05:00
Kevin Lange
5450546a15 [vga_font] Font rendering updates. 2011-03-28 16:29:59 -05:00
Kevin Lange
88b93880a6 [bochs] Font rendering, working on font still. Does numbers. 2011-03-28 15:18:48 -05:00
Kevin Lange
ee167bd889 [bochs] Perhaps I should work on something other than this display driver... 2011-03-27 13:41:00 -05:00
Kevin Lange
2686ba9cc1 [cpu] CPU detection by Brynet, BSD license 2011-03-26 21:36:49 -05:00
Kevin Lange
9057eade4e [bochs] Some simple display scrolling by 16 pixels 2011-03-26 14:15:24 -05:00
Kevin Lange
a62649aafe [main] Kernel argument parsing (of a limited sort); qemu vid mode defaults 2011-03-26 13:30:08 -05:00
Kevin Lange
216a91524b [vid] Fix up the graphics driver, support more stuff, boot logo. 2011-03-25 23:24:22 -05:00
Kevin Lange
4d3118bad7 [vid] Working on VBE graphics support for Bochs/Qemu 2011-03-25 22:29:54 -05:00
Kevin Lange
53024c3b49 [vga] Enable/disable cursor movement, for clock mostly 2011-03-25 01:13:44 -04:00
Kevin Lange
be3c4d2d04 [cmos] Add CMOS module 2011-03-25 01:09:23 -04:00
Kevin Lange
a84b5003f4 Classic text colors. 2011-03-24 20:24:59 -05:00
Kevin Lange
fffa6d99ae One task runs the clock, one task runs the shell. 2011-03-24 20:18:14 -05:00
Kevin Lange
80804862a4 [main] Huzzahs are in order. 2011-03-24 20:03:52 -05:00
Kevin Lange
41493d779c [task] Fuck everything about this, but it finally works. 2011-03-24 18:49:57 -05:00
Kevin Lange
0363ffdf34 [various pieces of garbage] 2011-03-24 18:24:24 -05:00
Kevin Lange
781659d67b [build] Various. 2011-03-22 00:57:24 -04:00
Kevin Lange
0b3ecfd4e4 Less-broken context switching, maybe? Also, run the terminal, type 'exit' 2011-03-03 23:12:26 -06:00
Kevin Lange
ee04a7271d [task] Holy crap, tasking. That took forever and it's still broken. 2011-03-01 17:48:39 -06:00
Kevin Lange
937f1dd547 [mem] Oops, don't forget that. 2011-02-27 22:00:08 -06:00
Kevin Lange
20efbe7b74 [boot] Well now, we have a stage two that almost does something 2011-02-21 23:51:06 -06:00
Kevin Lange
ebd3efb47b Revert "[boot] A third stage? Really?"
This reverts commit c23080c46c.
2011-02-21 19:36:18 -06:00
Kevin Lange
c23080c46c [boot] A third stage? Really? 2011-02-21 19:09:57 -06:00
Kevin Lange
e64ce6ba38 [boot] Boot modes in kernel startup... 2011-02-19 19:27:46 -06:00
Kevin Lange
0da56e6e51 [meta] Restructure directory tree and output files. 2011-02-12 16:47:20 -06:00