Commit Graph

43024 Commits

Author SHA1 Message Date
Alex Smith
5670b0a8e4 Moved the 32-bit page fault handler to arch_int.cpp, use it for x86_64.
A proper page fault handler was required for areas that were not locked
into the kernel address space. This enables the boot process to get
up to the point of trying to find the boot volume.
2012-07-09 19:18:09 +01:00
Alex Smith
c8049a88a3 Enabled hardware interrupt handler, timers now work and threads are preempted. 2012-07-09 17:42:34 +01:00
Alex Smith
b5c9d24abc Implemented threading for x86_64.
* Thread creation and switching is working fine, however threads do not yet
  get interrupted because I've not implemented hardware interrupt handling
  yet (I'll do that next).
* I've made some changes to struct iframe: I've removed the e/r prefixes
  from the member names for both 32/64, so now they're just named ip, ax,
  bp, etc. This makes it easier to write code that works with both 32/64
  without having to deal with different iframe member names.
2012-07-09 16:43:01 +01:00
Alex Smith
85d4a8bc4e Fixed compilation of C code using ELF headers. 2012-07-09 14:35:01 +01:00
Alex Smith
8c5e747190 Don't need to shift the factor in system_time(), just store the already shifted value. 2012-07-09 12:25:49 +01:00
Alex Smith
5e9bb17da7 Renamed remaining i386_* functions to x86_* for consistency. 2012-07-09 12:14:18 +01:00
Alex Smith
ee7aba5117 Print symbol information in a stack trace. 2012-07-09 11:54:03 +01:00
Alex Smith
3b802628b8 Support ELF64 in the kernel.
This has been done by adding typedefs in elf_common.h to the correct ELF
structures for the architecture, and changing all Elf32_* uses to those
types. I don't know whether image loading works as I cannot test it yet,
there may be some 64-bit safety issues around. However, symbol lookup for
the kernel is working correctly.
2012-07-09 11:11:38 +01:00
Alex Smith
bc3093488f Changes suggested by Ingo: style fix, and a system_time optimization. 2012-07-09 09:03:11 +01:00
Alex Smith
93cba1da96 Fixed a bug resulting from a mistake in the boot 64-bit paging setup.
This was an interesting bug to find. Was getting spurious triple faults
in the slab allocator. The problem was that the boot paging setup code
was mapping all page tables it created into the virtual address space,
but in the kernel no areas were being created to cover them, so during
arch_vm_init_end() the pages for them ended up being freed and then
overwritten later on. Fixed by unmapping page tables after populating
them in long_mmu_init().
2012-07-08 15:03:23 +01:00
Alex Smith
cc248cf2b3 A couple of bug fixes.
* mmu_get_virtual_mapping() should check that the page directory entry is
  present rather than assuming there's a page table there. This was resulting
  in some invalid mappings being created in the 64-bit virtual address space.
* arch_vm_init_end() should clear from KERNEL_LOAD_BASE to virtual_end, not
  from KERNEL_BASE. On x86_64 this was causing it to loop through ~512GB of
  address space, which obviously was taking quite a while.
2012-07-08 11:56:06 +01:00
Alex Smith
5c7d52183c Implemented system_time() for x86_64.
* Uses 64-bit multiplication, special handling for CPUs clocked < 1 GHz
  in system_time_nsecs() not required like on x86.
* Tested against a straight conversion of the x86 version, noticably
  faster with a large number of system_time() calls.
2012-07-08 10:16:44 +01:00
Alex Smith
7444a55ce5 Merge branch 'master' into x86_64 2012-07-06 15:55:59 +01:00
Alex Smith
c15176264b Compile APIC and timer code for x86_64, and create an area for the IDT. 2012-07-06 15:24:02 +01:00
Alex Smith
15feb60325 A few improvements suggested by Ingo. 2012-07-06 14:34:50 +01:00
Alex Smith
84bf29f97b Compile in arch_platform.cpp for x86_64. The apm_init call is disabled for x86_64, APM is 32-bit only. 2012-07-06 14:17:48 +01:00
Alex Smith
ab7726a2c4 Temporary fix for create_preloaded_image_areas. Will be replaced with a typedef later on. 2012-07-06 14:04:07 +01:00
Alex Smith
e276cc0457 Finished implementation of x86_64 paging.
* vm_init now runs up until create_preloaded_image_areas(), which needs
  fixing to handle ELF64.
* Not completely tested. I know Map(), Unmap() and Query() work fine, the
  other methods have not been tested as the kernel doesn't boot far enough
  for any of them to be called yet. As far as I know they're correct, though.
* Not yet implemented the destructor for X86VMTranslationMap64Bit or Init()
  for a user address space.
2012-07-06 12:52:35 +01:00
Alex Smith
11d35d1b9b Fixed tracing printf formats in VM code. 2012-07-05 20:17:31 +01:00
Alex Smith
1671cfdf2c Improved stack tracer, traces over iframes. 2012-07-05 16:11:11 +01:00
Alex Smith
898b29e362 Added temporary stack trace function to x86_64.
Will be merged with the x86 one later on. Requires -fno-omit-frame-pointer on
the kernel build flags, GCC defaults to not generating stack frames on x86_64.
2012-07-05 15:35:43 +01:00
Alex Smith
0da10c8b51 Some fixes to the long mode switch code.
* Wasn't storing the fixed virtual address of the PML4 in kernel_args.
* After switching to long mode, reload GDTR with the virtual address of
  the GDT. This was working fine until now because the physical address
  was identity mapped, but broke as soon as I removed the identity
  mapping.
2012-07-05 13:55:59 +01:00
Alex Smith
2f36ef5afe Fixed the x86_64 setjmp implementation.
* typedef for jmp_buf was using int where it should be long.
* setjmp was clearing the buffer pointer rather than the signal mask before
  calling sigsetjmp.
* KDL now works without crashing on x86_64.
2012-07-05 13:52:36 +01:00
Alex Smith
78d482e3b8 Style fixes. 2012-07-05 09:10:50 +01:00
Matt Madia
eb97152649 Updated CARootCertificates. 2012-07-04 20:37:22 -04:00
Alex Smith
d687d8ac70 Implementation of VMPhysicalPageMapper for x86_64 using the permanent physical memory mapping. 2012-07-04 19:57:48 +01:00
Alex Smith
40aeaeb907 Should enable CR4.PGE while switching to the kernel. 2012-07-04 18:39:23 +01:00
Alex Smith
a8f85e6e48 Removed accidently left in debug message. 2012-07-04 18:33:21 +01:00
Alex Smith
e70dd7e0af Map all physical memory in the long mode paging setup.
Since x86_64 has such a large virtual address space all available physical
memory can be mapped in to it. The physical page mapper implementation for
x86_64 will use this mapping. Also changed the mapping code to map kernel
pages with the global flag.
2012-07-04 18:28:50 +01:00
Alex Smith
950b24e32d Begun work on VMTranslationMap implementation for x86_64.
* Added empty source files for all the 64-bit paging method code, and a
  stub implementation of X86PagingMethod64Bit.
* arch_vm_translation_map.cpp has been modified to use X86PagingMethod64Bit
  on x86_64.
2012-07-04 17:08:44 +01:00
Alex Smith
4988ca58a0 Build arch_vm.cpp for x86_64. No changes required except for temporarily disabling bios_init call. 2012-07-04 14:55:11 +01:00
Alex Smith
428b9e758c Check whether gX86PagingMethod is NULL in arch_vm_translation_map_is_kernel_page_accessible.
This means that the kernel debugger won't cause a recursive panic if a
panic occurs before vm_init().
2012-07-04 14:23:35 +01:00
Alex Smith
4304bb9894 Added arch_cpu.cpp to the x86_64 build.
* Some things are currently ifndef'd out completely for x86_64 because
  they aren't implemented, there's a few other ifdef's to handle x86_64
  differences but most of the code works unchanged.
* Renamed some i386_* functions to x86_*.
* Added a temporary method for setting the current thread on x86_64
  (a global variable, not SMP safe). This will be changed to be done
  via the GS segment but I've not implemented that yet.
2012-07-04 14:06:46 +01:00
Humdinger
851c719d02 Small text changes in alert when renaming/moving special folders.
Since the button was renamed from "Do it!" to the specific action,
an additional explanation in case of special user folders isn't
needed any more.
Split text into paragraphs for better readability.
2012-07-04 08:42:38 +02:00
Alexandre Deckner
d061a70095 Fix WebPositive jamfile, cross building works 2012-07-04 02:57:38 +02:00
Alexandre Deckner
8ae2b062a6 Fix control flow, stop if gcc < 4. Change package URL 2012-07-04 01:49:32 +02:00
Alexandre Deckner
69914905f5 Remove left-over echo 2012-07-04 01:21:57 +02:00
Alexandre Deckner
40c493ce34 Hardcode kSVNRevision = 0 until i adapt version tracking 2012-07-04 01:18:37 +02:00
Alexandre Deckner
36aac7c55f Fix typo 2012-07-04 01:15:26 +02:00
Alexandre Deckner
c4ba387bf8 Adapt WebPositive build to make use of a webkit optional build package 2012-07-04 00:58:25 +02:00
Alex Smith
4e8fbfb2d1 x86_{read,write}_cr{0,4} can just be implemented as macros, put an x86_ prefix on the other read/write macros for consistency. 2012-07-03 20:55:36 +01:00
Alexandre Deckner
79adea9689 Fix src/apps/Jamfile alphabetical order
Thanks augiedoggie
2012-07-03 21:46:13 +02:00
Alexandre Deckner
08cada49a6 Apply old patch by AnevilYak, fix BMenuField border drawing
Should have been part of the previous commit, sorry
2012-07-03 21:43:53 +02:00
Alexandre Deckner
7f21f81f4f Apply old patch by AnevilYak, fix BMenuField border drawing 2012-07-03 21:31:18 +02:00
Alexandre Deckner
2ee4319d11 Remove unneeded includes 2012-07-03 21:29:38 +02:00
Alexandre Deckner
1ef59aee8e Add Jamfile for WebPositive 2012-07-03 21:12:20 +02:00
Alexandre Deckner
de3c221462 Merge WebPositive into the Haiku tree. History is preserved 2012-07-03 19:20:10 +02:00
Alex Smith
cbfe5fcd17 Removed redundant x86 sources/headers. 2012-07-03 17:38:18 +01:00
aldeck
a79446f471 * B_TRANSLATE_CONTEXT is now B_TRANSLATION_CONTEXT as per the recent change in Haiku, cf. hrev44041
git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@587 94f232f2-1747-11df-bad5-a5bfde151594
2012-07-03 15:45:33 +02:00
anevilyak
b4bab54a16 Be more specific about how we check the modifiers mask.
git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@586 94f232f2-1747-11df-bad5-a5bfde151594
2012-07-03 15:45:33 +02:00