Commit Graph

920 Commits

Author SHA1 Message Date
notion
fde77afb37 Ported my NewOS changes to OpenBeOS.
A couple of changes in various interrupt and thread functions and structures.
These make it now possible to change the stack at any time without making the kernel crash. This is needed for calling VESA 3.0 VBE functions through the protected mode interface.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-24 20:59:25 +00:00
David Reid
f8e2c34c67 Update the config_manager and pci modules.
This now reports better and starts configuring the busses we find.

There is still a long way to go but this another step on the way.

NB the information comes from 2 different methods and presently doesn't
   agree This is known and will be fixed, so please don't start yelling
   that it's broken! If people have strange debug information please
   let me have a copy so I can try to debug further :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-23 21:28:35 +00:00
David Reid
c8ca4b8cae Having an identity crisis!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@401 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-23 21:25:39 +00:00
Axel Dörfler
b9f8590233 Added sys/user calls for the open/create entry_ref/node_ref functions.
Added functions to retrieve set the fs_info structure (i.e. used to get the
partition's name); not implemented yet in the internal file systems.
Implemented the dir_create_entry_ref() function.
Re-ordered some parameters for the fs calls to be more consistent.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-23 14:10:12 +00:00
Axel Dörfler
c9d3e51155 Added syscalls for sys_open_entry_ref(), sys_create_entry_ref(),
sys_open_dir_(entry|node)_ref(), sys_create_dir_entry_ref().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-23 14:07:18 +00:00
beveloper
3ff18ff146 this adds address to symbol lookups to the kernel debugger. try the "ls <someaddr>" command.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-21 17:50:56 +00:00
beveloper
279d2a69e9 Because of the two cascaded PICs, we can't allow to ever diable IRQ 2.
arch_int_init has already enabled it, and enabling it again is never a problem.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@357 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-20 23:49:24 +00:00
lillo
01fb96c4c3 beos compatible timer routines and style cleanups in timer and sem code
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@353 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-20 22:52:04 +00:00
Axel Dörfler
071f62bc36 Major code cleanup and reorganisation.
Fixed many bugs.
Now, the vfs_ prefix is for functions that are called by other parts of the
kernel. file_ is for file related stuff, dir_ for directory related, and
common_ for both, fs_ for general file system stuff.
Put all prefixed functions together in the source.
Implemented (currently without a user/sys call) opening/creating of entry_refs,
and node_refs (the latter for opening directories only).
Moved vfs_dup(), and vfs_dup2() to fd.c, fd_dup(), and fd_dup2().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@351 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-20 00:16:12 +00:00
David Reid
6ec6552ee4 Small change to remove a bug in removal.
This in association with Michael N in IRC.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@350 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 19:25:37 +00:00
David Reid
b1dba4cbd5 Fix the interrupt handling...
we now differntiate between an I/O interrupt (ie one that is likely
to be triggered by a device on the system using an IRQ between
0 and 15) and one that we're creating to allow us to have functions
called for events, ie a software interrupt. Behaviour is all
commented in the file int.c, but you need to make sure that you call the
correct version.

install_io_interrupt_handler now needs an IRQ value between 0 and 15 and
will treat the irq as one it needs to enable/disable

install_interrupt_handler is for software interrupts and is essentially
the function we had.

For mroe read the comments in the file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@348 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 18:33:41 +00:00
David Reid
48377a24b0 Few changes...
- catch up with the changes to the interrupt functions
- change the way we handle the list of handlers to use a standard
  function rather than a home spun one :)
- don't add every function on a pci device as a seperate device
- add more info to the pci_info structure
- when FULL_MONTY turned on show more information


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 16:07:36 +00:00
David Reid
9adc7af78a Change to the interrupt handler return values.
Also reflect the change of function name and number of
parameters.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 16:04:12 +00:00
David Reid
5186a4c76b Change to the interrupt handler return values.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@337 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 16:01:15 +00:00
Axel Dörfler
8480ee0c2c We now have a completely working "pwd" command; dir_vnode_to_path() is
fully implemented.
I removed all those insane INSANE() debug output and found what made
the difference between a working and a crashing kernel - will have
to investigate this later, because those two lines a) really belong
there, and b) even if they are there, the kernel shouldn't crash just
because of that.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 04:20:07 +00:00
Axel Dörfler
16326dafb6 Added a missing newline.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@328 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 02:48:27 +00:00
David Reid
e76a020d33 Begone ERR_NO_MEMORY!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 01:36:28 +00:00
David Reid
c099d735dd Add pools.c to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 01:35:54 +00:00
David Reid
eab8081ffd Change the modules code to use the new hash code.
This fixed a lot of ongoing segfaults which were both intermittent
and unpredicatble.
Also improve some logic so we take a shorter path in simple_module_info


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@323 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 01:32:42 +00:00
David Reid
6ecc5c9950 The new hash code.
Essentially the code that the net stack used. the code is based on the
hash impl. in APR, that was itself based on a large number of different
people's efforts and various papers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@322 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 01:27:22 +00:00
David Reid
0c1eef852d Add pools to the build
Remove some duplicated build options
Comment out the beos section as it's not really of interest to people
not working on the modules/device code :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@320 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 01:23:24 +00:00
David Reid
90bc2d5f53 Big change to the way that PCI works.
- make pci into a true module now.
- the pci module builds and keeps a linked list of devices it finds, with
  a filled in pci_info structure
- pci module detects (at runtime) whcih config mech to use, though to date
  only mech 1 is implemented
- pci module does sanity check and warns if it fails
- config manager loads pci module and calls get_nth_pci_info to iterate
  through the list printing details
- pci is no longer called directly from the bus init function

there is still lots to do and I've tried to make sure that there are plenty
of comments in the pci.c file. I've also left the previous code in
place until we move on a little further when it will be removed.

This has been working with no problems on my system and doesn't change
any functionality as we don't have any devices that need PCI in our build
yet.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@319 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 01:20:15 +00:00
Axel Dörfler
63c5cc0aa1 Removed the big hack called vnode_to_path(), and replaced it with the real
thing dir_vnode_to_path().
But beware, it's not yet working correctly - will fix it later, I have no
time anymore.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@315 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 21:06:02 +00:00
Axel Dörfler
5213b70b42 Fixed a warning I introduced earlier.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@313 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 20:42:52 +00:00
Axel Dörfler
4bb2d8915b Implemented geist's recent change to mutexes - they are now no longer
benaphores; benaphores aren't that beneficial in kernel land, the benaphores
are a way to reduce the number of kernel calls.
They can now only be released by the same thread who originally acquired it.

Included other changes geist (change 1499) did to a) fix some bugs, and
b) reflect the changes made to the mutexes.
Cleaned the files a bit up, all the commented dprintf()s in elf.c are now
deactivated through a macro.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 19:21:40 +00:00
Axel Dörfler
de8acfc621 Fixed the messed up indentation (8 spaces instead of tabs)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 15:03:13 +00:00
Axel Dörfler
eb0471173e The kernel will now call arch_cpu_idle() in its main loop.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 14:19:53 +00:00
Axel Dörfler
3d4008e5e4 Added the arch_cpu_idle() call to all platforms, though only x86 really
implements it yet (from freston).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 14:19:14 +00:00
lillo
92622c9c58 adding environmental variables support
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@305 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 14:07:56 +00:00
lillo
0ba337c0a4 adding environmental variables support
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 13:59:03 +00:00
Philippe Houdoin
2c24125957 dbg_add_command() changed into BeOS compatible add_debugger_command().
remove_debugger_command() added.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-17 22:07:37 +00:00
beveloper
08b993b215 remove use of unterminated strings
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@283 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-17 18:29:41 +00:00
David Reid
333119344a Another attempt to fix the module loading problem. I've also added
a load of comments explaining why it does the things it does.

In the get_module code we now correctly
call the init function, which was being missed before if we got
the module via search_module.

If people can test and confirm this works. It works here and has solved
all the issues I was trying to fix.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@276 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-17 16:08:53 +00:00
David Reid
b0bdff5216 Small fix to prevent a segfault.
Provide more info when a duplicate module name is detected during a scan.
Remove some code we no longer use.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@274 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-17 12:51:48 +00:00
Axel Dörfler
cbe085bc5a Forgot some debug stuff...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-17 08:12:41 +00:00
Axel Dörfler
243d156e21 sys_seek() now returns the stream position as an off_t.
Minor bug fixes.
fd_close() now doesn't have to call remove_fd() anymore - it's now called
in user|sys_close(), fd_close() is now only called in the last put_fd().
Cleanup, improved debug output (without any warnings).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@266 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-17 07:55:51 +00:00
lillo
2b94bc7ba9 hopefully fixed the bochs debug issue
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@252 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-16 12:39:57 +00:00
lillo
c4786ea6c4 Made bochs e9 hack switchable by configure
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@249 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-15 23:42:06 +00:00
lillo
8367bc2f55 small fix to make threads to return meaningful values on exit
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@218 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 13:34:00 +00:00
David Reid
82610abc62 Make some changes o the ISA nad PCI modules and add the start of a config
manager module. As time goes on we can start fleshing these out.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 10:36:32 +00:00
David Reid
7cf327ff5e ERR_NO_MEMORY -> ENOMEM
ERR_INVALID_ARGS -> EINVAL
CVSR_NOMEMO----------------------------------------------------------------


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 10:22:17 +00:00
David Reid
4b6ac4574c Remove the isa test case as it now works and maintaiing it was a waste of
time as we will have lots more cases to test with :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 10:17:26 +00:00
David Reid
f2c397eac9 ERR_NO_MEMORY -> ENOMEM
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@213 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 10:15:14 +00:00
David Reid
faf1362d13 Continue removing ERR_INVALID_ARGS in favour of EINVAL
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@212 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 10:14:29 +00:00
David Reid
dfc6d0bbbd Tidy up some error values we're passing. Essentially remove the ERR_SEM
errors, though these will need to be checked.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@211 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 10:10:22 +00:00
Axel Dörfler
3b120ea240 Updated the code to reflect the changes in the VFS.
Fixed some bugs in fd.c (how many more bugs can be in a small file like this? :-).
Added the syscalls for sys_open_dir(), and sys_create_dir().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@209 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 05:15:34 +00:00
Axel Dörfler
ea536d2ba4 Updated VFS, more POSIX like open/create, has now extra open_dir/create_dir
functions. sys_create() now returns an fd of the open file (some code in the
kernel shell already depend on this).
Moved the seek functions to fd.c.
Updated all internal file systems to a new and updated API.
vfs.c is not cleaned up well, but also has some bug fixes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@208 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-14 05:13:20 +00:00
David Reid
cdbcdb71d9 Marcus pointed this out! Thanks.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@176 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-13 00:55:02 +00:00
David Reid
1255f4f403 drivers.h is now Drivers.h
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@168 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 23:27:32 +00:00
David Reid
b1c8e50995 Renmove net stuff from the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@151 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 20:25:24 +00:00
David Reid
4ab9bc87a6 Add snooze!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 20:24:28 +00:00
beveloper
5667d23a37 fixed a bug
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@142 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 17:47:38 +00:00
David Reid
4828a5e712 Comment out the socket syscall as we don't have any socket code in
the build at the moment.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 14:54:25 +00:00
David Reid
4cb55da05c Remove the networking code until it's ready.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 14:53:25 +00:00
David Reid
9ca7451251 Swap the order of the headers so we have everything defined and so avoid
the warnings about sem_info and port_info (defined in kernel/OS.h)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 10:15:18 +00:00
David Reid
d2de8b3867 Include kerrors.h where it's required.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@105 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-11 22:21:56 +00:00
David Reid
f6327bfa2e ERR -> E
Change header includes if reqd.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@104 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-11 22:21:16 +00:00
David Reid
c90a447062 ERR -> E
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-11 22:19:52 +00:00
David Reid
394b2aa25b ERR -> E
CVSR -> E------------------------------------------------------------------


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-11 22:18:07 +00:00
David Reid
082fc2ba6d If Axel doesn't want to maintain this then why are we still building it?
Remove the iso9660 stuff from the build as it's no longer being
maintained and never did anything anyways :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@98 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-11 21:49:34 +00:00
David Reid
d700c5a3cf More adjustments to deal with POSIX codes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@92 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-11 21:25:29 +00:00
David Reid
d71118c74f Change to using POSIX error codes and adjust the includes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@91 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-11 21:24:54 +00:00
Axel Dörfler
07fefdf493 Implemented the read_dir(), and rewind_dir() functions for all internal
file systems.
Removed the read() functionality for directories.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@63 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 21:55:33 +00:00
Axel Dörfler
be28e9bd97 Added the syscalls for sys_read_dir(), and sys_rewind_dir(), and moved the
use of the IOCPARM_LEN() macro to the ioctl() function in libc.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@61 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 21:49:37 +00:00
Axel Dörfler
65dc706027 Converted module.c to use sys_read_dir() instead of sys_read(). But it really
should use opendir(), and readdir().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@60 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 21:48:27 +00:00
Axel Dörfler
c1f7f96bbf Added a parameter for the maximum number of dirents for sys_read_dir().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@59 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 21:47:38 +00:00
Axel Dörfler
f2e60e56e0 Added missing a newline.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@39 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 15:48:19 +00:00
David Reid
434d5d1923 As this seemed to be going round and round with no-one fixing it, here
is a fix.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@34 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 13:08:47 +00:00
Ingo Weinhold
54f76689cb Adjusted the SubDir and SubInclude parameters.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@15 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 20:15:44 +00:00
ejakowatz
52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00