Commit Graph

6933 Commits

Author SHA1 Message Date
Alex Smith
3fde53501d Updated x86_64 fenv.h and added fenv.c. 2012-07-27 15:21:41 +01:00
Alex Smith
e3ac2588e6 Changed runtime_loader to use elf_* typedefs over Elf32_*.
This means that it will be using ELF64 types on x86_64 rather than
ELF32. The next step for supporting x86_64 is to implement relocations.
2012-07-25 15:05:21 +01:00
Alex Smith
370ab57d49 Initial userland support for x86_64.
Userland switch is implemented, as is basic system call support (using
SYSCALL/SYSRET). The system call handler is not yet complete: it doesn't
handle more than 6 arguments, and does not perform all the necessary kernel
entry/exit work (neither does the interrupt handler). However, this is
sufficient for runtime_loader to start and print some debug output.
2012-07-23 17:12:12 +01:00
Alex Smith
59ae45c1ab Fixed commpage for x86_64.
Since the commpage is at a kernel address, changed 64-bit paging code
to match x86's behaviour of allowing user-accessible mappings to be
created in the kernel portion of the address space. This is also
required by some drivers.
2012-07-21 16:18:10 +01:00
Alex Smith
195a0f350e Changed argument type of fcntl syscall from uint32 to size_t.
Since this argument may be used to pass pointers, uint32 is not
correct for 64-bit. Effectively no change on 32-bit targets, both
size_t and uint32 are unsigned long there.
2012-07-21 14:33:27 +01:00
Alex Smith
5f6b522746 Merge branch 'master' into x86_64 2012-07-21 14:17:22 +01:00
Alex Smith
6497f6b1ec Moved the exception handling functions to arch_int.cpp, shared between x86 and x86_64. 2012-07-21 09:11:09 +01:00
Rene Gollent
902a98ad83 Fix #8753.
- Store whether or not the use of the horizontal scrollbar is desired
  on the class itself. If the CLV was set to use the horizontal scrollbar,
  and then asked to lay itself out while hidden, it would incorrectly assume
  the horizontal scrollbar wasn't in use, and consequently repositioned its
  views such that the horizontal scrollbar and outline view overlapped.
2012-07-20 19:35:21 -04:00
Ingo Weinhold
af350aa218 Add private shared class ArgumentVector
The parser is based on the FS shell's ArgVector.
2012-07-20 23:32:58 +02:00
Alex Smith
82694bd124 Merge branch 'master' into x86_64
Conflicts:
	headers/posix/arch/x86_64/arch_setjmp.h
	src/system/kernel/cache/block_cache.cpp
2012-07-20 18:33:46 +01:00
Alex Smith
1b41387b5f Added missing packed attributes on disk_identifier. 2012-07-20 17:14:17 +01:00
Alex Smith
12bd7812dd Ported PCI module to x86_64.
Uses the x86 architecture code, made fixes to printf formats and a
couple of 64-bit fixes. Only potentially intrusive change is that I've
changed PCI.h to use uint32 rather than ulong. I don't see any way
this would cause any issues, though.
2012-07-20 12:00:20 +01:00
Matt Madia
173f54f147 Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
John Scipione
4bb5af765f Add control mark color setting. #8054
An enhancement adding a setting to Colors under Appearance to
set the mark color of radio button and check box controls.
2012-07-15 15:09:04 -04:00
Alex Smith
368f253347 Merge branch 'master' into x86_64 2012-07-14 08:49:14 +01:00
Alex Smith
bcb07a319b Implemented the rest of the kernel debugger functions for x86_64.
Merged with the x86 implementations, mostly the same except for a
few differences. GDB stub is currently broken, will investigate
later.
2012-07-13 14:09:09 +01:00
Rene Gollent
639e18555f Fix indentation and match parameter names with .cpp. 2012-07-12 19:47:04 -04:00
Rene Gollent
0e20120117 Fix build, header changes were forgotten in previous commit. 2012-07-12 19:38:09 -04:00
Fredrik Holmqvist
a51a5f3e1e Fixes to Haiku specific code to work with ACPICA 20120711. 2012-07-12 18:32:56 +02:00
Alex Smith
4ebc6dfa68 Moved some 32-bit specific stuff to the 32 subdirectory. 2012-07-12 14:23:55 +01:00
Alex Smith
d38f1301d1 Cleaned up 32-bit descriptors.h. 2012-07-12 13:55:03 +01:00
Alex Smith
c3f0fd28cd Fixed formatting of output in some debugger commands.
Currently all debugger commands assume 32-bit pointers when formatting their
output. This means that on x86_64 the output is incorrectly formatted. Fixed
this by adding a B_PRINTF_POINTER_WIDTH definition (16 on 64-bit, 8 on
32-bit), and using this to correctly format the output. Not all commands have
been fixed yet, but all VM, slab, VFS, team, thread and image commands should
be correct.
2012-07-12 11:29:33 +01:00
Alex Smith
76a1175dbe Support for SMP on x86_64.
No major changes to the kernel: just compiled in arch_smp.cpp and fixed the
IDT load in arch_cpu_init_percpu to use the correct limit for x86_64 (uses
sizeof(interrupt_descriptor)). In the boot loader, changed smp_boot_other_cpus
to construct a temporary GDT and get the page directory address from CR3, as
what's in kernel_args will be 64-bit stuff and will not work to switch the
CPUs into 32-bit mode in the trampoline code. Refactored 64-bit kernel entry
code to not use the stack after disabling paging, as the secondary CPUs are
given a 32-bit virtual stack address by the SMP trampoline code which will
no longer work.
2012-07-11 18:29:15 +01:00
Alex Smith
659bacac26 Compile arch_real_time_clock.cpp and arch_system_info.cpp for x86_64. 2012-07-11 14:43:44 +01:00
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
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
5e9bb17da7 Renamed remaining i386_* functions to x86_* for consistency. 2012-07-09 12:14:18 +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
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
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
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
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
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
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
Alex Smith
cbfe5fcd17 Removed redundant x86 sources/headers. 2012-07-03 17:38:18 +01:00
Alex Smith
c005e747ef Removed the x86_64 headers/source directories, now all merged with x86. 2012-07-03 11:17:56 +01:00
Alex Smith
020a25ce46 Fixed x86_64 kernel compilation.
For now I've just put all the stub functions that are needed to link the
kernel into a file called stubs.cpp. I've not yet moved across the interrupt
handling code or the ELF64 relocation code to the x86 directory. Once those
have been moved I can get rid of the x86_64 headers/source directories.
2012-07-02 20:56:27 +01:00
Alex Smith
0897e314b7 Merged x86_64 headers into x86 headers.
Not many changes seeing as there's not much x86_64 stuff done yet. Small
differences are handled with ifdefs, large differences (descriptors.h,
struct iframe) have separate headers under arch/x86/32 and arch/x86/64.
2012-07-02 18:47:06 +01:00
Alex Smith
120585d549 Merge branch 'master' into x86_64 2012-07-02 09:39:42 +01:00
Michael Lotz
fcc4ecb0c7 Add debug_calloc() to the debug_heap. 2012-07-01 06:37:25 +02:00
Pawel Dziepak
06e8742063 Fix #8643: AVLTreeMap strategy Auto discards const
Signed-off-by: Ingo Weinhold <ingo_weinhold@gmx.de>
2012-06-29 01:37:33 +02:00
Alex Smith
294711f98c Changed {,u}int64 to be long rather than long long on x86_64. 2012-06-28 12:36:45 +01:00
Alex Smith
0705884ac4 Style fixes. 2012-06-27 15:48:39 +01:00
Alex Smith
c9f6d2271f x86_64: Implemented exception handling. 2012-06-27 15:18:10 +01:00
Alex Smith
575a67c7a1 Merge branch 'master' into x86_64 2012-06-27 11:28:28 +01:00
Alex Smith
3403f23e81 Moved the common parts of arch_cpu.h between x86 and x86_64 to arch/common_x86/cpu.h. 2012-06-27 11:23:54 +01:00
Alex Smith
e5fc2bfcab Implemented long mode setup/switch code, the bootloader can now start the 64-bit kernel!
The setup procedure is fairly simple: create a 64-bit GDT and 64-bit page
tables that include all kernel mappings from the 32-bit address space, but at
the correct 64-bit address, then go through kernel_args and changes all virtual
addresses to 64-bit addresses, and finally switch to long mode and jump to the
kernel.
2012-06-26 11:08:21 +01:00