Commit Graph

2675 Commits

Author SHA1 Message Date
Ingo Weinhold
10a83ac31f * Added tlbia() and tlbie() macros. Replaced ptesync() by ppc_sync();
the fact that I couldn't find ptesync in an otherwise more complete
  documentation I downloaded yesterday made me suspicious.
* arch_cpu_global_TLB_invalidate() uses tlbia now. The instruction is
  optional, but so is tlbie (how I understood it is that both exist,
  when the architecture implementation has a TLB). And the former loop
  looked just scary.
* Implemented arch_cpu_user_TLB_invalidate(). It does just the same as
  arch_cpu_global_TLB_invalidate().
* Some changes with respect to synchronization required on page table
  and segment register updates.
* Some more minor renaming. Pulled a new function
  remove_page_table_entry() out of unmap_tmap().
* In arch_vm_translation_map_init_post_area() we do now remap the page
  table into the kernel address space, if it was without before. The
  page table might actually be a good application for BAT, though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-01 21:40:27 +00:00
Ingo Weinhold
7c8af51f81 Added ptesync().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-01 14:44:29 +00:00
Ingo Weinhold
957a1b17eb * Introduced new build system variables
{HAIKU,HOST,TARGET}_KERNEL_PIC_{CC,LINK}FLAGS which define the
  compiler/linker flags specifying the kind of position independence
  the kernel shall have. For x86 we had and still have -fno-pic, but the
  PPC kernel has -fPIE (position independent executable) now, as we
  need to relocate it.
* The boot loader relocates the kernel now. Mostly copied the relocation
  code from the kernel ELF loader. Almost completely rewrote the PPC
  specific relocation code, though. It's more correct and more complete now
  (some things are still missing though).
* Added boot platform awareness to the kernel. Moved the generic
  Open Firmware code (openfirmware.c/h) from the boot loader to the kernel.
* The kernel PPC serial debug output is sent to the console for the time
  being.
* The PPC boot loader counts the CPUs now and allocates the kernel stacks
  (made OF device iteration a bit more flexible on the way -- the search
  can be restricted to subtree). Furthermore we really enter the kernel...
  (Yay! :-) ... and crash in the first dprintf() (in the atomic_set()
  called by acquire_spinlock()). kprintf() works, though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15756 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 21:20:07 +00:00
Ingo Weinhold
8d99b63e92 Added missing PPC relocation type.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 19:49:42 +00:00
Axel Dörfler
f17cfabc82 * Fixed BBox resizing when not attached.
* Less flickering when drawing the label: the area of the label is now
  clipped, so there is no need to fill the background again.
* Consumed the last reserved member for the bounding box of the label.
* More or less rewrote the header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 18:23:48 +00:00
Ingo Weinhold
be950af4df Removed unused kernel_args fields.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 17:56:52 +00:00
Axel Dörfler
4acb99b60f Implemented reference counting of ServerBitmaps, made constructor and destructor private,
as only the BitmapManager class is allowed to call them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 15:36:18 +00:00
Axel Dörfler
93052717b0 Renamed AS_LAYER_GET_{DRAW|BLEND}_MODE to *_{DRAWING|BLENDING}_MODE.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 15:06:24 +00:00
Axel Dörfler
e351ecb78d Renamed BView::_SetViewImage() to _SetViewBitmap(), and AS_LAYER_SET_VIEW_IMAGE
to AS_LAYER_SET_VIEW_BITMAP.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 14:52:43 +00:00
Ingo Weinhold
c83d9dad1c * platform_allocate_region() has a new boolean parameter "exactAddress"
specifying whether only the exact supplied address is acceptable. If
  false, the address is considered a hint only. It will be picked, if
  available, otherwise a greater address is tried to be acquired, and
  as last resort any address. This feature is only implemented for PPC.
  It is needed since the preferred kernel text base address 0x80000000
  might not be available (and actually isn't on my Mac mini).
* Fixed a bug in the PPC memory management code:
  is_{virtual,physical}_allocated() were checking whether the given
  range was completely contained by an existing range instead of
  checking for intersection. As a consequence we could (and did) allocate
  a range intersecting with already allocated ranges. The kernel segment
  thus overwrote OF memory for instance.
* The ELF loader makes sure that it got both text and data segment of
  the image to be loaded.

The PPC boot loader successfully loads kernel and modules now. Next
comes the hard part, I'm afraid.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15708 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 01:50:23 +00:00
Ingo Weinhold
8cfaf4b974 For PPC the read/write (==data) segment is actually executable
(it contains the PLT).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15706 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 01:19:45 +00:00
Ingo Weinhold
d561d0ad68 Added a mini networking stack to the boot loader. It speaks basic ARP,
IP, and UDP, as well as a home brewn UDP based protocol, "remote disk",
which provides random access to a single remote file/device. The Open
Firmware flavored boot loader automatically initializes the net stack,
searches for a remote disk, and tries to boot from it, if the boot
device is a network device (e.g. when loading the boot loader via
TFTP).

This is quite nice for developing with a two-machine setup, since one
doesn't even need to install Haiku on the test machine anymore, but can
serve it directly from the development machine. When the networking
support in the kernel is working, this method could even be used to
fully boot, not just for loading kernel and initial modules.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15689 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-27 22:01:33 +00:00
Ingo Weinhold
9897917b9c Added (more Be-ish) Add() methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-27 21:08:02 +00:00
Ingo Weinhold
d0714598fd Fixed PPC build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-27 01:51:43 +00:00
Stefano Ceccherini
2c6856d660 more cleanups. I'll probably end up rewriting the etire header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-26 10:16:22 +00:00
Stefano Ceccherini
66080bed4a Sorry for breaking the build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15668 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-25 10:43:24 +00:00
Stefano Ceccherini
a66e501974 more cleanup. I can't seem to be able to clone the vesa accelerant so I'm a bit stuck at the moment
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15665 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-24 14:20:44 +00:00
Stefano Ceccherini
ed58e05e18 Partly converted the header to our coding style, added some debug output, started to clean up
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-24 13:06:05 +00:00
Axel Dörfler
db39fa281e Moved the headers of the different store implementations into the VM source
directory; they are not used outside the VM.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 20:08:49 +00:00
Axel Dörfler
ea2cd27e57 * Fixed the strange vm_cache_ref reference count mechanism: now, a fresh
vm_cache_ref starts with a reference count of 1. When acquiring a vm_cache,
  you no longer need to worry if that should go through the vm_store, or not;
  as it now always does.
* map_backing_store() no longer needs to play with the vm_cache_ref
  references.
* that simplified some code.
* vfs_get_vnode_cache() now grabs a reference to the cache, if successful.
* better balanced vnode ownership on vnode_store creation (vnode_store
  released the vnode before if its creation failed).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15641 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 17:00:03 +00:00
Axel Dörfler
79f73dbc56 * vm_page::offset is now called cache_offset and is now an uint32 instead of off_t;
this saves 4 bytes per page. To compensate the loss of bytes, the offset is now
  stored in page size units, that's enough to address 2^44 or 16 TB (which is now
  the maximal supported file size!).
* Renamed vm_page::ppn to physical_page_number.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 12:38:31 +00:00
Stephan Aßmus
1f0a4ee8c7 removed unused stuff from Painter and DrawingEngine, fixed the deadlock when trying to use the (20 times faster) DrawingEngine version of StringWidth, the font is now usually ignored when taking on a DrawState in Painter... should add a little speed overall
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:39:54 +00:00
Stefano Ceccherini
d69c048704 No longer needed
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15619 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:13:31 +00:00
Axel Dörfler
35cf51550c Replaced arch/thread_struct.h with arch/thread_types.h, and renamed
arch/*/thread_struct.h to arch_thread_types.h, so that it can directly
be included without having to specify the architecure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15616 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 16:07:27 +00:00
Axel Dörfler
d608540b67 Separated vm_address_space.h from vm.h.
Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 15:54:45 +00:00
Stefano Ceccherini
700b38edc4 Started porting WindowScreen to haiku
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15612 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 14:31:26 +00:00
Axel Dörfler
96e01a27bf * Merged vm_virtual_map with vm_address_space - there was no reason to have
them apart (this even saves a pointer from vm_virtual_map to its address space)
* aspace -> address_space
* vm_create_address_space() did not check if creating the semaphore succeeded
* Removed team::kaspace - was not really needed (introduced a new vm_kernel_address_space()
  function that doesn't grab a reference to the address space)
* Removed vm_address_space::name - it was just a copy of the team name, anyway,
  and there is always only one address space per team
* Removed aspace_id - the address space is now using the team_id
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 13:29:11 +00:00
Waldemar Kornewald
ce823541ec Removed #ifdef __cplusplus from networking headers. The check is already done in cdefs.h (__BEGIN_DECLS) which I committed yesterday.
Committed libnetwork.so. I actually wanted to port BSD's libc/net resolver, but that one uses too many unsupported functions, so I basically merged libbind.so and libsocket.so into one library.

Moved the libbind.so sources to libnetwork/dns.

Cleaned up native part of libbind.so a little bit more. Though, the ugly hack remains. We nbetter pthread/mutex support. Added TODO that we also shousctl() into the kernel and libroot.so.

Improved DEVNOTES a little bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15605 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 10:54:58 +00:00
Axel Dörfler
9d845483cf Got rid of two ToDo-items: instead of clearing the PAGE_MODIFIED flag after having
written the page, we now do it before, so that it cannot lose any changed data
anymore; it doesn't matter if the page is written to while writing it back, the
worst thing that can happen is that we write the same page twice. Also, we don't
rely on the PAGE_MODIFIED bit anymore, we now check all mappings of that page
to find all modified pages, no matter how far the (currently disabled) page
daemon had come.
Also, destroying an area will now result in writing back changed pages - this
is only really important for memory mapped files, though, and should probably
be avoided for other vm_store types.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 23:01:11 +00:00
Jérôme Duval
37a84232bb fix build for echo drivers, added cs_timer.h from pcmcia-cs
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 18:57:29 +00:00
Waldemar Kornewald
8c85eedc66 Moved the needed headers from private to posix folder. This should hopefully fix the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 17:42:05 +00:00
Ingo Weinhold
4c62b0919f Pulled platform independent part of the BIOS boot menu out into
platform/generic/...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 13:35:01 +00:00
Waldemar Kornewald
f7a223fa1b Removed unneeded libbind files (were never compiled, anyway).
Moved some headers around and cleaned them up.

Fixed threading code in libbind.so. Don't know why I hadn't noticed this before. Now it is reliable, but uses an even uglier hack.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15585 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 13:26:54 +00:00
Axel Dörfler
39cc80346c * Implemented automatic font_directory creation for font_mappings.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 12:02:17 +00:00
Stefano Ceccherini
70da1fab92 Haiku doesn't have byteorder.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 10:52:48 +00:00
Axel Dörfler
1bd3bb1d58 * Added fallback mappings for the default fonts - since we don't save the
mappings yet, that's a good way to test this functionality.
* Turns out the directory of the mappings must be known already - they
  should be added automatically, but I've added them manually for now
  (which is okay for the default system directory).
* Having more than one style with the same family in the mappings didn't
  work as planned - it now does.
* On my current system, time spend in the font manager constructor went
  down from 1.5 secs to around 12000 usecs (and I have only a moderate
  number of fonts installed, or so I thought - looks like the mappings
  were a good idea :-)) - and that directly cuts down the boot time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15580 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 01:01:04 +00:00
Waldemar Kornewald
5352d6baaa Updated DEVNOTES. It's finally complete, now.
Fixed headers:
- added checks for C++
- removed _REENTRANT checks


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15572 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-17 11:58:39 +00:00
Waldemar Kornewald
c544064d35 Updated BIND resolver library (libbind.so) to version 9.3.1.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-16 22:38:13 +00:00
Jérôme Duval
f6486d9d01 added some more headers from pcmcia-cs
fixed the build for non haiku platforms


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15569 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-16 19:06:45 +00:00
Axel Dörfler
d0d37bdfd1 * vfs_init() is now called later in the startup sequence - since no core kernel
service depends on it, it doesn't make any sense to call it that early in the
  game.
* The VFS now has a low memory handler for vnodes as well. If there is enough
  memory left, it won't free any vnodes anymore.
* Potential crashing bug fix: some functions did not check if the FD passed
  in belonged to the right type; they just assumed it had a valid vnode, but
  it could have had a mount structure associated as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-16 16:11:36 +00:00
Axel Dörfler
7d7f4675bb * Added some cpuid eax == 1 feature definitions to arch_cpu.h
* Renamed IA32_MTR_WRITE_COMBINED to IA32_MTR_WRITE_COMBINING.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15559 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-16 12:25:49 +00:00
Axel Dörfler
348c7214f5 Improved processor identification for some VIA C3 models.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15558 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-16 11:55:01 +00:00
Axel Dörfler
1534aa236c Added new function vm_low_memory_state() that returns the current low
memory status.
Added new B_NO_LOW_MEMORY constant for the usual case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15551 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-15 21:30:28 +00:00
Jérôme Duval
4f9f2ee29d added a pcmcia bus raw driver compatible with R5
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15540 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 22:50:05 +00:00
Rudolf Cornelissen
42a631e9fa removed one more old nolonger used define for 3D.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15539 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 20:53:54 +00:00
Rudolf Cornelissen
3c8313fd87 two more command sub-defines needed for DMA scaled blit function. Also removed some old and nolonger used PIO mode command defines.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15537 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 18:38:24 +00:00
Axel Dörfler
e0e9a3e69f * We now support the global page feature of x86 processors that prevents
kernel TLBs from being flushed on context switch.
* new arch_cpu_user_TLB_invalidate() that now does what arch_cpu_global_TLB_invalidate()
  did before.
* arch_cpu_global_TLB_invalidate() will now flush all TLBs, even those from the
  kernel.
* some cleanups.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 17:07:37 +00:00
Axel Dörfler
484c80abd0 * Added missing prototypes for get_eflags() and set_eflags() to arch_system_info.h
* The boot loader now checks the CPU for the cpuid and rdtsc features, which we
  currently both rely on.
* Removed old and no longer used stage2_priv.h header


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 10:43:28 +00:00
Stephan Aßmus
025e63b08a added functions to quickly tell if the pattern is the solid high or low pattern
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 08:01:49 +00:00
Axel Dörfler
51a3c450be The short story: we now have MTRR support on Intel and AMD CPUs (the latter
has not yet been tested, though - I'll do this after this commit):
* Removed the arch_memory_type stuff from vm_area; since there are only 8 memory
  ranges on x86, it's simply overkill. The MTRR code now remembers the area ID
  and finds the MTRR that way (it could also iterate over the existing MTRRs).
* Introduced some post_modules() init functions.
* If the other x86 CPUs out there don't differ a lot, MTRR functionality might
  be put back into the kernel.
* x86_write_msr() was broken, it wrote the 64 bit number with the 32 bit words
  switched - it took me some time (and lots of #GPs) to figure that one out.
* Removed the macro read_ebp() and introduced a function x86_read_ebp()
  (it's not really a time critical call).
* Followed the Intel docs on how to change MTRRs (symmetrically on all CPUs
  with caches turned off).
* Asking for memory types will automatically change the requested length to
  a power of two - note that BeOS seems to behave in the same, although that's
  not really very clean.
* fixed MTRRs are ignored for now - we should make sure at least, though,
  that they are identical on all CPUs (or turn them off, even though I'd
  prefer the BIOS stuff to be uncacheable, which we don't enforce yet, though).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-13 16:34:29 +00:00