Initial snapshot
This commit is contained in:
commit
fee4dd4e6d
373 changed files with 62144 additions and 0 deletions
47
sample/Makefile
Normal file
47
sample/Makefile
Normal file
|
@ -0,0 +1,47 @@
|
|||
#
|
||||
# ---------- header -----------------------------------------------------------
|
||||
#
|
||||
# project kaneton
|
||||
#
|
||||
# license kaneton
|
||||
#
|
||||
# file /home/mycure/kaneton/sample/Makefile
|
||||
#
|
||||
# created julien quintard [sun jun 10 14:54:43 2007]
|
||||
# updated julien quintard [fri may 1 21:55:31 2009]
|
||||
#
|
||||
|
||||
#
|
||||
# ---------- dependencies -----------------------------------------------------
|
||||
#
|
||||
|
||||
include ../environment/env.mk
|
||||
|
||||
#
|
||||
# ---------- directives -------------------------------------------------------
|
||||
#
|
||||
|
||||
.PHONY: main clear prototypes headers
|
||||
|
||||
#
|
||||
# ---------- variables --------------------------------------------------------
|
||||
#
|
||||
|
||||
SUBDIRS := chiche
|
||||
|
||||
#
|
||||
# ---------- rules ------------------------------------------------------------
|
||||
#
|
||||
|
||||
main:
|
||||
|
||||
clear:
|
||||
for d in $(SUBDIRS) ; do \
|
||||
$(call env_launch,$${d}/Makefile,clear,) ; \
|
||||
done
|
||||
|
||||
$(call env_purge,)
|
||||
|
||||
prototypes:
|
||||
|
||||
headers:
|
76
sample/chiche/Makefile
Normal file
76
sample/chiche/Makefile
Normal file
|
@ -0,0 +1,76 @@
|
|||
##
|
||||
## licence kaneton licence
|
||||
##
|
||||
## project kaneton
|
||||
##
|
||||
## file /home/buckman/kaneton/drivers/mod/Makefile
|
||||
##
|
||||
## created julien quintard [fri feb 11 03:00:09 2005]
|
||||
## updated matthieu bucchianeri [sat may 5 18:22:24 2007]
|
||||
##
|
||||
|
||||
#
|
||||
# ---------- dependencies -----------------------------------------------------
|
||||
#
|
||||
|
||||
include ../../environment/env.mk
|
||||
|
||||
#
|
||||
# ---------- directives -------------------------------------------------------
|
||||
#
|
||||
|
||||
.PHONY: libs clear prototypes
|
||||
|
||||
#
|
||||
# ---------- variables --------------------------------------------------------
|
||||
#
|
||||
|
||||
CHICHE := chiche
|
||||
|
||||
CHICHE_C := chiche.c
|
||||
CHICHE_O := $(CHICHE_C:.c=.o)
|
||||
CHICHE_H := $(_SAMPLE_DIR_)/chiche/chiche.h
|
||||
|
||||
CRT_S := _crt.S
|
||||
CRT_O := $(CRT_S:.S=.o)
|
||||
|
||||
KAYOU_C := _kayou.c
|
||||
KAYOU_O := $(KAYOU_C:.c=.o)
|
||||
|
||||
#
|
||||
# ---------- rules ------------------------------------------------------------
|
||||
#
|
||||
ifeq ($(behaviour),default)
|
||||
|
||||
main: dependencies $(CHICHE)
|
||||
|
||||
$(CHICHE): $(CRT_O) $(KAYOU_O) $(CHICHE_O)
|
||||
$(call env_executable,$(CHICHE), \
|
||||
$(CRT_O) \
|
||||
$(KAYOU_O) \
|
||||
$(CHICHE_O), \
|
||||
$(_SERVICE_LAYOUT_), \
|
||||
$(ENV_OPTION_NO_STANDARD))
|
||||
|
||||
clear:
|
||||
$(call env_remove,$(CRT_O),)
|
||||
$(call env_remove,$(KAYOU_O),)
|
||||
$(call env_remove,$(CHICHE_O),)
|
||||
$(call env_remove,$(CHICHE),)
|
||||
|
||||
$(call env_purge,)
|
||||
|
||||
prototypes:
|
||||
echo $(CHICHE_H)
|
||||
$(call env_prototypes,$(CHICHE_H),)
|
||||
|
||||
headers:
|
||||
|
||||
dependencies:
|
||||
|
||||
endif
|
||||
#
|
||||
# ---------- dependencies -----------------------------------------------------
|
||||
#
|
||||
|
||||
-include ./$(_DEPENDENCY_MK_)
|
70
sample/chiche/_crt.S
Normal file
70
sample/chiche/_crt.S
Normal file
|
@ -0,0 +1,70 @@
|
|||
.text
|
||||
.global _start
|
||||
.type _start,%function
|
||||
|
||||
.type main,%function
|
||||
.type _kayou,%function
|
||||
|
||||
_start:
|
||||
/* Clear the frame pointer. The ABI suggests this be done, to mark
|
||||
the outermost frame obviously. */
|
||||
xorl %ebp, %ebp
|
||||
|
||||
/* Extract the arguments as encoded on the stack and set up
|
||||
the arguments for `main': argc, argv. envp will be determined
|
||||
later in __libc_start_main. */
|
||||
|
||||
movl $__task_id, %edi
|
||||
popl 0(%edi)
|
||||
popl 4(%edi)
|
||||
movl $__as_id, %edi
|
||||
popl 0(%edi)
|
||||
popl 4(%edi)
|
||||
|
||||
popl %esi /* Pop the argument count. */
|
||||
movl %esp, %ecx /* argv starts just at the current stack top.*/
|
||||
|
||||
/* Before pushing the arguments align the stack to a 16-byte
|
||||
(SSE needs 16-byte alignment) boundary to avoid penalties from
|
||||
misaligned accesses. Thanks to Edward Seidl <seidl@janed.com>
|
||||
for pointing this out. */
|
||||
andl $0xfffffff0, %esp
|
||||
pushl %eax /* Push garbage because we allocate
|
||||
28 more bytes. */
|
||||
|
||||
/* Provide the highest stack address to the user code (for stacks
|
||||
which grow downwards). */
|
||||
pushl %esp
|
||||
|
||||
pushl %ecx /* Push second argument: argv. */
|
||||
pushl %esi /* Push first argument: argc. */
|
||||
|
||||
pushl $main
|
||||
|
||||
/* Call the user's main function, and exit with its value.
|
||||
But let the libc call main. */
|
||||
call _kayou
|
||||
|
||||
hlt /* Crash if somehow `exit' does return. */
|
||||
.size _start,.-_start
|
||||
|
||||
/* Define a symbol for the first piece of initialized data. */
|
||||
.data
|
||||
.global __task_id
|
||||
__task_id:
|
||||
.long 0
|
||||
.long 0
|
||||
.global __as_id
|
||||
__as_id:
|
||||
.long 0
|
||||
.long 0
|
||||
.global __system_id
|
||||
__system_id:
|
||||
.long 0
|
||||
.long 0
|
||||
|
||||
.global __data_start
|
||||
__data_start:
|
||||
.long 0
|
||||
.weak data_start
|
||||
data_start = __data_start
|
38
sample/chiche/_kayou.c
Normal file
38
sample/chiche/_kayou.c
Normal file
|
@ -0,0 +1,38 @@
|
|||
void *__libc_stack_end = (void*)0;
|
||||
|
||||
/*
|
||||
* Declare the __environ global variable and create a strong alias environ.
|
||||
* Note: Apparently we must initialize __environ to ensure that the strong
|
||||
* environ symbol is also included.
|
||||
*/
|
||||
char **__environ = 0;
|
||||
|
||||
/* __uClibc_main is the new main stub for uClibc. This function is
|
||||
* called from crt1 (version 0.9.28 or newer), after ALL shared libraries
|
||||
* are initialized, just before we call the application's main function.
|
||||
*/
|
||||
void _kayou(int (*main)(int, char **, char **),
|
||||
int argc,
|
||||
char **argv,
|
||||
void *stack_end)
|
||||
{
|
||||
__libc_stack_end = stack_end;
|
||||
|
||||
/* The environment begins right after argv. */
|
||||
__environ = &argv[argc + 1];
|
||||
|
||||
/* If the first thing after argv is the arguments
|
||||
* the the environment is empty. */
|
||||
if ((char *) __environ == *argv) {
|
||||
/* Make __environ point to the NULL at argv[argc] */
|
||||
__environ = &argv[argc];
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, invoke application's main and then exit.
|
||||
*/
|
||||
main(argc, argv, __environ);
|
||||
|
||||
while (1)
|
||||
;
|
||||
}
|
26
sample/chiche/chiche.c
Normal file
26
sample/chiche/chiche.c
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* ---------- header ----------------------------------------------------------
|
||||
*
|
||||
* project kaneton
|
||||
*
|
||||
* license kaneton
|
||||
*
|
||||
* file /home/mycure/kaneton.STABLE/sample/chiche/chiche.c
|
||||
*
|
||||
* created matthieu bucchianeri [sat jun 9 18:36:19 2007]
|
||||
* updated julien quintard [sat dec 4 01:07:04 2010]
|
||||
*/
|
||||
|
||||
#include "chiche.h"
|
||||
|
||||
/*
|
||||
* main() function.
|
||||
*/
|
||||
|
||||
int main(void)
|
||||
{
|
||||
while (1)
|
||||
;
|
||||
|
||||
return (0);
|
||||
}
|
32
sample/chiche/chiche.h
Normal file
32
sample/chiche/chiche.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* licence kaneton licence
|
||||
*
|
||||
* project kaneton
|
||||
*
|
||||
* file /home/buckman/kaneton.bak/drivers/cons-simple/cons-simple.h
|
||||
*
|
||||
* created matthieu bucchianeri [thu may 31 21:28:04 2007]
|
||||
* updated matthieu bucchianeri [sat jun 9 22:37:53 2007]
|
||||
*/
|
||||
|
||||
#ifndef SAMPLE_CHICHE_CHICHE_H
|
||||
#define SAMPLE_CHICHE_CHICHE_H 1
|
||||
|
||||
/*
|
||||
* ---------- prototypes ------------------------------------------------------
|
||||
*
|
||||
* chiche.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* chiche.c
|
||||
*/
|
||||
|
||||
int main(void);
|
||||
|
||||
|
||||
/*
|
||||
* eop
|
||||
*/
|
||||
|
||||
#endif
|
Reference in a new issue