[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Schemix-devel] Updates to Schemix
From: |
Cory Cross |
Subject: |
[Schemix-devel] Updates to Schemix |
Date: |
Fri, 31 Dec 2004 03:06:47 -0500 |
User-agent: |
Mozilla Thunderbird 1.0 (X11/20041206) |
Hi everyone (if there is more than one...),
The short:
I started updating Schemix for the 2.6 kernels. It compiles/runs
fine (to my limited testing, anyway) without kallsyms/devfs sections
included. However, kallsyms has changed drastically since 2.4, and there
are many changes needed. DevFS has many more. I replace the
kernel_module( name ) function to one that now works in my test module.
The diff is attached. However, the new code doesn't actually need or use
anything from kallsyms.
What next:
I will be working on kernel_lookup() next, but I need some help. I
don't understand very well what the memory_reference struct is, so if
someone can explain it to me I will be most gracious.
About me:
I am a student in Computer Engineering at the University with
interests including low-level programming and embedded systems. I also
find the LispOS project fascinating. These two come together for my
reasons for interest in this project: 1. See if a garbage-collecting,
buffer-overrun-preventing language like Scheme or Lisp can form
effective low-level/kernel code in less time than C, and 2. Replacing
init with a Lisp or Scheme interpreter and adding Schemix to the kernel
would allow people to work on something LispOS-like from both userland
and kernelland at the same time, without having to deal with details
like boot code right away. I started working heavily on this project
over the last few days because it is Christmas break and I go crazy if I
have down time!
The diff:
It is applied against schemix.c in schemix-0.2.1
Thank you
Cory Cross
1337c1337
< /* The next few functions were taken from modutils/examples. */
---
> /* The next few functions were created by Cory Cross */
1340,1341d1339
< extern const char __start___kallsyms[];
< extern const char __stop___kallsyms[];
1343,1376c1341,1342
< static struct module *local_module_list;
<
< static void get_module_list(void)
< {
< const struct kallsyms_header *ka_hdr;
< const struct kallsyms_section *ka_sec;
< const struct kallsyms_symbol *ka_sym;
< const char *ka_str;
< int i;
< const char *p;
<
< if (__start___kallsyms >= __stop___kallsyms)
< return;
< ka_hdr = (struct kallsyms_header *)__start___kallsyms;
< ka_sec = (struct kallsyms_section *)
< ((char *)(ka_hdr) + ka_hdr->section_off);
< ka_sym = (struct kallsyms_symbol *)
< ((char *)(ka_hdr) + ka_hdr->symbol_off);
< ka_str =
< ((char *)(ka_hdr) + ka_hdr->string_off);
<
< for (i = 0;
< i < ka_hdr->symbols;
< kallsyms_next_sym(ka_hdr, ka_sym), ++i) {
< p = ka_str + ka_sym->name_off;
< if (strcmp(p, "module_list") == 0) {
< if (ka_sym->symbol_addr)
< local_module_list = *((struct module
**)(ka_sym->symbol_addr));
< break;
< }
< }
< }
<
< /* Find a module by its name */
---
> /*Find a module by its name,
> this function doesn't actually use any kallsyms-specific features*/
1379,1391c1345,1378
< struct module *m;
< get_module_list();
<
< if( strcmp( name, "kernel" ) == 0 )
< for( m = local_module_list; m; m = m->next )
< if( *(m->name) == 0 )
< return m;
<
< for( m = local_module_list; m; m = m->next )
< if( strcmp( name, m->name ) == 0 )
< return m;
<
< return NULL;
---
> /*Pointers used to iterate through modules*/
> struct module *itr,*holder;
> /*Search string*/
> char *search;
>
> /*If name is NULL, return NULL*/
> if(!name)
> return 0;
>
> /*The kernel has a special name,
> so we need to change the search string to find it*/
> if( strcmp( name, "kernel" ) == 0 ) {
> search = vmalloc(2);
> search[0] = (char)1;search[1] = (char)0;
> }
> else {
> search = name;
> }
>
> /*This construct is from linux/list.h*/
> list_for_each_entry_safe(itr,holder,&THIS_MODULE->list,list) {
>
> /*If our search string matches the module name...*/
> if( strcmp( search, itr->name ) == 0 ) {
> if( strcmp( name, "kernel" ) == 0 )
> vfree(search);
> return itr;
> }
> }
>
> /*module not found...*/
> if( strcmp( name, "kernel" ) == 0 )
> vfree(search);
> return 0;
1393a1381
>
4612a4601
> unsigned int n; /*used down below*/
4635c4624
< unsigned int n;
---
> /*unsigned int n; moved to above*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Schemix-devel] Updates to Schemix,
Cory Cross <=