Re: RFC: i386: kill !4KSTACKS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 6 Sep 2005 18:19:45 -0400, Daniel Phillips <[email protected]> said:

  Daniel> There are only two stacks involved, the normal kernel stack
  Daniel> and your new ndis stack.  You save ESP of the kernel stack

Sadly, that is not the case: Some drivers, especially USB drivers,
create multiple threads (those threads are created through
ndiswrapper, so if any massaging needs to be done, ndiswrapper can do
that). However, it is not multiple threads that is the problem, but
switching of stacks. On transition from Windows function to Linux
function, we need to copy the arguments that are in Windows stack into
Linux stack so Linux function gets the arguments. We need to do same
thing in the reverse direction. As mentioned before, this gets
complicated with different calling conventions and different number of
arguments to functions. Moreover, if Linux kernel decides to suspend a
thread while it is executing Windows function, kernel sees an invalid
stack.

  Daniel> You will allocate your own stack once on driver
  Daniel> initialization.

Rather, whenever a new thread is created.

  Daniel> I missed something there.  You would switch stacks before
  Daniel> calling the Windows code and after the Windows code calls
  Daniel> you (and respective returns) so you are always in your own
  Daniel> code when you switch, hence you know how to copy the
  Daniel> parameters.

This is not impossible, but messy (even if the very idea ndiswrapper
itself sounds scary to some).

  Daniel> By the way, I use ndis_wrapper, thanks a lot you guys!

Good to know you are happy.

-- 
Giri
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux