Messages in this thread | | | From | "Kendall Bennett" <> | Date | Fri, 17 Jul 1998 12:38:23 -0800 | Subject | Re: I/O permissions for V86 tasks (Enhanced V86 Mode)? |
| |
> I appear to have been wrong about that. The tss->bitmap value contains a > pointer to the start of the IO bitmap relative to the start of the TSS. > So in theory the bitmap could be moved to the end of the TSS and made > to be of variable size; the code which will need changing, apart from the > definition of thread_struct, is... > > - the ioperm() code > - the fork code in process.c which initialises the bitmap > - the macro set_tss_desc and any code which uses it. > > If the IO bitmap is created with a default size then you might get away > with not changing the code which allocates space for the thread_struct. > The IO bitmap size will need to be stored somewhere - add an extra element > to the thread_struct. I guess what will happen is if ioperm() is called > with ports which are not covered by the bitmap it allocates a larger TSS. > After doing that I guess it will need to cause a task switch.
Ok, I like this idea. I think I understand most of the above and am willing to try hacking it into my kernel sources, but I am not clear on two things:
1) If I reallocate space for the I/O bitmap, how would I do this? Is there a krealloc() function or something to enlarge the size of a kernel memory object? Or would I simply alloc a new one (do I use malloc or something else?) for the larger size, copy the old TSS to it, and free the old one? Or can I simply allocate an 8Kb block for the new I/O bitmap and simply point the TSS at it (but then I would need to free it later right?).
2) Once I have enlarged the memory block if the TSS has moved to a new location how do I then inform the kernel that the TSS has moved so it knows about it?
3) I understand the need to cause a task switch, but how would I accomplish this?
Regards,
+--------------------------------------------------------------------------+ | SciTech Software - Building Truly Plug'n'Play Software! | +--------------------------------------------------------------------------+ | Kendall Bennett | Email: KendallB@scitechsoft.com | | Director of Engineering | Phone: (530) 894 8400 | | SciTech Software, Inc. | Fax : (530) 894 9069 | | 505 Wall Street | ftp : ftp.scitechsoft.com | | Chico, CA 95928, USA | www : http://www.scitechsoft.com | +--------------------------------------------------------------------------+
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |