akaros.git
10 years ago timer works in bochs and on physical machine. need global definition for bochs...
David Zhu [Wed, 22 Apr 2009 01:59:06 +0000 (18:59 -0700)]
  timer works in bochs and on physical machine. need global definition for bochs specific udelay_pit

10 years ago Cleanup JOS references and add typedefs
David Zhu [Wed, 22 Apr 2009 01:22:30 +0000 (18:22 -0700)]
Cleanup JOS references and add typedefs

    Cleaned up all legacy references to JOS and turned them into ROSs.  Also typedefed all structs to be a
    *_t type.

10 years agoBarrier work
Barret Rhoden [Sat, 18 Apr 2009 00:58:47 +0000 (17:58 -0700)]
Barrier work

Changed barrier to use a counter instead of a mask.

10 years agoChecklists
Barret Rhoden [Fri, 17 Apr 2009 23:09:58 +0000 (16:09 -0700)]
Checklists

Implemented and passes some tests.  Some more BIT macros and atomic ops.

10 years agoCan support up to 1GB of RAM
Barret Rhoden [Thu, 16 Apr 2009 02:01:30 +0000 (19:01 -0700)]
Can support up to 1GB of RAM

The pages struct array will map all of physical RAM, but the KERNBASE
mapping will only map as much as can be held in it's VA space (a little
less than a GB, due to the APIC mappings at the top).

10 years agoSmall commits to the .gitignore file
Kevin Klues [Thu, 16 Apr 2009 01:44:17 +0000 (18:44 -0700)]
Small commits to the .gitignore file

10 years agoAdded memory detection using multiboot_info
Kevin Klues [Wed, 15 Apr 2009 20:21:04 +0000 (13:21 -0700)]
Added memory detection using multiboot_info

Changed to using multiboot_info structure to extract the available RAM on the system. Also changed the ghetto
timeouts from smp.c to be contained in a #define in smp.h so that they can be customized to the specific
machine you are running on. Right now we just have values for the default architecture and the __BOCHS__
architecture. To define the architecture in use, simply add ARCH=__BOCHS__ or similar on the command line when
you compile

10 years agoAdded bitmask macros
Barret Rhoden [Wed, 15 Apr 2009 19:15:53 +0000 (12:15 -0700)]
Added bitmask macros

10 years agoAdmin / Makefile
Barret Rhoden [Tue, 14 Apr 2009 18:23:48 +0000 (11:23 -0700)]
Admin / Makefile

merged my makefile changes, so i don't have to keep hiding them every
time i commit.  also added .bochsrc to .gitignore.

10 years agoGlobal pages support.
Barret Rhoden [Tue, 14 Apr 2009 08:00:13 +0000 (01:00 -0700)]
Global pages support.

Used for all of the boot_mappings.  Someone should check to see if they
are getting applied.  More difficult would be to see how effective they
are (TLB hits on context switches for the kernel mappings), and if the
non-jumbo PDEs do anything with the PTE_G flag.

10 years agoSMP MTRRs
Barret Rhoden [Tue, 14 Apr 2009 07:32:44 +0000 (00:32 -0700)]
SMP MTRRs

Sets up the MTRRs the same (and hopefully correctly) across all cores.
Fixes up a couple minor details in the SMP booting and LAPIC ExtINT
setup.

10 years agodisable_irqsave can be called first
Barret Rhoden [Mon, 13 Apr 2009 23:27:15 +0000 (16:27 -0700)]
disable_irqsave can be called first

enable and disable can be called with either first, with ints being the
same as they were at the beginning of the pair.  also allows for nesting
on the same state variable.  comes with a test and some macros for
printd and printk.

10 years agoBasic MTRRs
Barret Rhoden [Mon, 13 Apr 2009 21:30:13 +0000 (14:30 -0700)]
Basic MTRRs

Set up for Core0 to enable its MTRRs.  Will later do all cores at once
in SMP boot.

10 years agoMoved SMP Boot functions into kern/smp.{h,c}
Barret Rhoden [Thu, 9 Apr 2009 22:36:26 +0000 (15:36 -0700)]
Moved SMP Boot functions into kern/smp.{h,c}

10 years agoSMP function call helpers
Barret Rhoden [Thu, 9 Apr 2009 04:45:43 +0000 (21:45 -0700)]
SMP function call helpers

Creates helpers to call functions across all cores or a subset of cores,
mostly just registration and IPI sending.  Needs work, esp with knowing
when to proceed (esp when overwriting the IDT), and some wmb() love.

10 years agoSMP barrier is reusable
Barret Rhoden [Wed, 8 Apr 2009 22:58:02 +0000 (15:58 -0700)]
SMP barrier is reusable

can now be called multiple times (resets itself) after having been
initialized.  also renamed to barrier_all.

10 years agoFixed double page count incrementing in seg alloc
Barret Rhoden [Wed, 8 Apr 2009 20:25:27 +0000 (13:25 -0700)]
Fixed double page count incrementing in seg alloc

10 years agoprimitive barrier and testing helpers
Barret Rhoden [Wed, 8 Apr 2009 18:43:04 +0000 (11:43 -0700)]
primitive barrier and testing helpers

added a barrier, needs to be init'd.  moved the atomics to kern/, and
added some more testing infrastructure.

10 years agoBochs compatible SMP booting and enable_irqsave()
Barret Rhoden [Fri, 3 Apr 2009 23:58:19 +0000 (16:58 -0700)]
Bochs compatible SMP booting and enable_irqsave()

Bochs didn't like receiving a second SIPI when HLTed (or ever, I think).
This removes the second SIPI, which kvm and the corei7 don't need.  Also
adds some functionality to enable/disabling interrupts.

10 years agoSMP booting race and caching
Barret Rhoden [Fri, 3 Apr 2009 20:55:41 +0000 (13:55 -0700)]
SMP booting race and caching

Reworked some timing and locking in smp_boot / smp_entry to avoid some
race issues.  Read the comments.  Also fixed some cache-enabling issues.
Also, Bochs doesn't like the HLT in smp_entry.S.  Don't care for now.

10 years agoMoved some functions into kern/testing
Barret Rhoden [Fri, 27 Mar 2009 23:05:35 +0000 (16:05 -0700)]
Moved some functions into kern/testing

This could use some work - making them more useful, adding
new ones, and reincarnating old tests from elsewhere.

10 years agospin_lock_irqsave
Barret Rhoden [Fri, 27 Mar 2009 20:50:10 +0000 (13:50 -0700)]
spin_lock_irqsave

10 years agoAdded mon_cpuinfo and removed an annoying warning
Barret Rhoden [Thu, 26 Mar 2009 21:24:49 +0000 (14:24 -0700)]
Added mon_cpuinfo and removed an annoying warning

10 years agoLAPIC logical ID support for IPIs
Barret Rhoden [Thu, 26 Mar 2009 06:12:49 +0000 (23:12 -0700)]
LAPIC logical ID support for IPIs

Also removed some (unnecessary) segmentation register reloading.  Left
commented out for now.  Also has a variety of IPI tests, left for
posterity in this commit.  Successfully runs on a 16 way KVM.  Booya.

10 years agoSMP booting (mostly) done
Barret Rhoden [Thu, 26 Mar 2009 00:44:36 +0000 (17:44 -0700)]
SMP booting (mostly) done

APs are loaded and capable of receiving IPIs on their own stacks.
Would like a better way to wait for all cpus having booted.  The timer
thing is decent, and will probably be the best way - once I take out
those time-intensive cprintfs.

10 years agoSpinlock work
Barret Rhoden [Wed, 25 Mar 2009 23:06:12 +0000 (16:06 -0700)]
Spinlock work

Fixed spin_lock, templated spin_lock_irqsave, and protect vcprintfs with
a lock (allows interleaving of output at the vcprintf granularity)

10 years agoSMP stacks and initial INT handling
Barret Rhoden [Wed, 25 Mar 2009 01:28:17 +0000 (18:28 -0700)]
SMP stacks and initial INT handling

Per-core stacks, pages of which include per-core GDT and Taskstates.
Currently using the same IDT for all cores, and the same
interrupt_handler table.  Also removed the old "sizeof(struct
Trapframe)" from the bootstack_top and smp variety.  Not sure why it was
there, and it works fine without it.

10 years agoSpinlock and SMP booting
Barret Rhoden [Tue, 24 Mar 2009 06:48:34 +0000 (23:48 -0700)]
Spinlock and SMP booting

Added spin_lock and some initial other atomic ops.  Used them to hack up
a way for core0 to wait a bit (timer), then wait for the other cores to
finish their smp_main()s.

10 years agoMore PIC, PIT, and registration of ISRs
Barret Rhoden [Tue, 24 Mar 2009 02:31:42 +0000 (19:31 -0700)]
More PIC, PIT, and registration of ISRs

Additional PIC functionality (masking), ability to program the PIT, and
a mechanism to register an interrupt handler.  Changed the smp_boot to
use the new registration system.

10 years agoBochs compatible SMP
Barret Rhoden [Mon, 23 Mar 2009 08:50:25 +0000 (01:50 -0700)]
Bochs compatible SMP

PSE is set in assembly for APs, the LAPIC timer wait is cranked down,
and the PIC is masked.  KVM didn't need to mask the PIC - masking LINT0
was enough to block the ExtINT, but Bochs was still getting the PIT
interrupt.

10 years agoSMP Booting, APIC, and IRQs
Barret Rhoden [Mon, 23 Mar 2009 06:01:01 +0000 (23:01 -0700)]
SMP Booting, APIC, and IRQs

Lots of things in this, would have liked to split it up, but they are
rather woven together.  Primitive SMP booting, some basic APIC work,
basic IRQ work, and other x86 infrastructure.  Backtrace works too.

10 years agoLAPIC memory mapping
Barret Rhoden [Sun, 8 Mar 2009 21:45:17 +0000 (14:45 -0700)]
LAPIC memory mapping

Creates page table mapping for the APIC area (0xfee00000), which should
be removed when we have MTRR support, I think.

10 years agoTrap work
Barret Rhoden [Sun, 8 Mar 2009 21:37:04 +0000 (14:37 -0700)]
Trap work

Set all IDT entries to use interrupt gates for now, til IRQ and APIC
issues are sorted.  DF might need to be NOEC (is now, though the books
say it generates an EC).  Long range, DF might be a task gate (it is in
linux).

10 years agoMSR support and more CPUID info
Barret Rhoden [Sat, 7 Mar 2009 23:44:05 +0000 (15:44 -0800)]
MSR support and more CPUID info

10 years agoSome Deputization with IN_HANDLER
Zach Anderson [Wed, 4 Mar 2009 02:30:09 +0000 (18:30 -0800)]
Some Deputization with IN_HANDLER

Putting IN_HANDLER in some of the places it should go, and added empty
handler entry and exit functions.

10 years agoAdds support for DANGEROUS annotation
Zach Anderson [Wed, 4 Mar 2009 00:21:31 +0000 (16:21 -0800)]
Adds support for DANGEROUS annotation

Used to mark userspace pointers, which can't be dereferenced
until checked.  Also sorts some Makefrag and pgdir issues.
REBUILD YOUR IVY

10 years agoDeputy turned on. YOU NEED TO UPDATE YOUR IVY
Zach Anderson [Fri, 27 Feb 2009 20:03:10 +0000 (12:03 -0800)]
Deputy turned on.  YOU NEED TO UPDATE YOUR IVY

Compiles with --deputy now, with select files ignored with #pramga
nodeputy.  Most files are currently ignored, but this will allow
incremental deputization of the project.

10 years agoRemoved parallel output
Barret Rhoden [Wed, 25 Feb 2009 02:22:43 +0000 (18:22 -0800)]
Removed parallel output

Each character put was really slow when trying to output it to the
parallel port on real hardware (presumably because nothing is listening,
or perhaps due to the ugly delay()ing).  The only thing that used it was
Bochs, so just go ahead and redirect your serial out to a terminal like
a real man/woman.

10 years agoFriendly with GCC > 4.1
Barret Rhoden [Wed, 25 Feb 2009 01:17:12 +0000 (17:17 -0800)]
Friendly with GCC > 4.1

10 years agoFencepost
Barret Rhoden [Mon, 23 Feb 2009 21:48:20 +0000 (13:48 -0800)]
Fencepost

10 years agoMemory protection and page fault handling
Barret Rhoden [Mon, 23 Feb 2009 09:13:13 +0000 (01:13 -0800)]
Memory protection and page fault handling

Moved and improved the user memory check function, new panics on kernel
page faults, and processes learn their Env* early on.  User processes
provide some testing.

10 years agoInitial syscall support
Barret Rhoden [Mon, 23 Feb 2009 06:44:02 +0000 (22:44 -0800)]
Initial syscall support

'goodbye world' works, but needs actual testing.

10 years agoRudimentary breakpoint handling
Barret Rhoden [Mon, 23 Feb 2009 05:12:28 +0000 (21:12 -0800)]
Rudimentary breakpoint handling

10 years agoFixed traphandlers; they were backwards.
Barret Rhoden [Mon, 23 Feb 2009 02:53:29 +0000 (18:53 -0800)]
Fixed traphandlers; they were backwards.

If you want to learn something, go back a commit, run the four fault*
userprograms, and debug the problem based on the output.  This patch
also changes softint to texas's intentions, since we now have the fault
programs.

10 years agoPoor man's KVM reboot.
Barret Rhoden [Mon, 23 Feb 2009 01:45:02 +0000 (17:45 -0800)]
Poor man's KVM reboot.

10 years agoPermissions on IDTs.
Barret Rhoden [Mon, 23 Feb 2009 00:26:51 +0000 (16:26 -0800)]
Permissions on IDTs.

See user/softint.c for more info.

10 years agoIDT set up
Barret Rhoden [Fri, 20 Feb 2009 09:01:55 +0000 (01:01 -0800)]
IDT set up

Handles the setup of the IDT and handler functions.  Doesn't do much
other than detect and print out messages.  Backtrace doesn't work right
once kicked to the monitor.  O/W, things seem fine.

10 years agoLab3, Env support
Barret Rhoden [Thu, 19 Feb 2009 21:50:37 +0000 (13:50 -0800)]
Lab3, Env support

basic environment infrastructure.  not fully tested, but seems to work
okay.  need to remove the panic if you want to test it out, but unless
you are stepping in a debugger, the system will crash when hello
attempts a syscall.

10 years agoTwo-level page permissions fixes
Barret Rhoden [Wed, 18 Feb 2009 01:18:31 +0000 (17:18 -0800)]
Two-level page permissions fixes

showmapping now properly considers the PDE.  PDE permissions are set
during pgdir_walks so that the userspace UVPT mapping can actually see
pages other than 'UPD'.  Added checks for permissions in check_boot.

10 years agoadded my .gitignore. treat like other local-specific files.
Barret Rhoden [Mon, 16 Feb 2009 04:55:03 +0000 (20:55 -0800)]
added my .gitignore.  treat like other local-specific files.

10 years agoChecks for PSE support, just for yucks.
Barret Rhoden [Fri, 13 Feb 2009 20:01:45 +0000 (12:01 -0800)]
Checks for PSE support, just for yucks.

10 years agoFixed backtrace
Barret Rhoden [Wed, 11 Feb 2009 07:18:55 +0000 (23:18 -0800)]
Fixed backtrace

10 years agoLab3 initial merge
Barret Rhoden [Fri, 6 Feb 2009 01:10:30 +0000 (17:10 -0800)]
Lab3 initial merge

10 years agoInitial support for PSE
Barret Rhoden [Thu, 5 Feb 2009 08:43:09 +0000 (00:43 -0800)]
Initial support for PSE

Doesn't check CPUID for the PSE capability (not a big deal, actually,
but nice to do right / know how to do).  Maps all of the KERNBASE
mappings with jumbo pages, but that's it.  Grep pmap for PSE status for
more info.

10 years agoImproved backtrace and added some mapping commands
Barret Rhoden [Thu, 5 Feb 2009 04:11:09 +0000 (20:11 -0800)]
Improved backtrace and added some mapping commands

10 years agoLab2, exercise 6, basic paging
Barret Rhoden [Wed, 4 Feb 2009 04:35:30 +0000 (20:35 -0800)]
Lab2, exercise 6, basic paging

Nothing that relies on the boot_alloc and friends.  Passes all of their
tests, haven't run any other tests.

10 years agoLab2, exercise 4 - basic VM init, paging
Barret Rhoden [Tue, 3 Feb 2009 22:29:53 +0000 (14:29 -0800)]
Lab2, exercise 4 - basic VM init, paging

Could use some more tests in check_boot_pgdir, but seems to be okay.

10 years agoMinor changes to ROS and make infrastructure
Barret Rhoden [Sun, 1 Feb 2009 03:47:15 +0000 (19:47 -0800)]
Minor changes to ROS and make infrastructure

kern/Makefrag is set to a default everyone can use, and not just
specific to my environment with mnt/hdd, etc.  if you want to change
yours, run git update-index --assume-unchanged kern/Makefrag.  i did the
same with .bochsrc.

10 years agoAdded serial output for the console. It's sweet.
Barret Rhoden [Sat, 31 Jan 2009 05:55:10 +0000 (21:55 -0800)]
Added serial output for the console.  It's sweet.

10 years agoLab2 work in progress. Helper functions, touchups
Barret Rhoden [Sat, 31 Jan 2009 05:53:33 +0000 (21:53 -0800)]
Lab2 work in progress.  Helper functions, touchups

10 years agoKevin's changes and some Ivy.
Barret Rhoden [Wed, 28 Jan 2009 03:54:44 +0000 (19:54 -0800)]
Kevin's changes and some Ivy.

Some ivy work, but does not compile with deputy yet (due also to my
changes to monitor.c).

Most of kevin's changes from lab1 made it too.  Anything missing is
cosmetic or didn't fit with the end of lab1 things I did.

10 years agoLab2 merges, compiles now
Barret Rhoden [Sat, 24 Jan 2009 18:28:03 +0000 (10:28 -0800)]
Lab2 merges, compiles now

10 years agoLab2 initial changes
Barret Rhoden [Fri, 23 Jan 2009 20:46:41 +0000 (12:46 -0800)]
Lab2 initial changes

10 years agoEnd of Lab1
Barret Rhoden [Fri, 23 Jan 2009 20:25:52 +0000 (12:25 -0800)]
End of Lab1