Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
[app] convert the existing apps to the app modules, add new shell app to
Browse files Browse the repository at this point in the history
contain the console
  • Loading branch information
travisg committed Jan 25, 2009
1 parent 6837223 commit 3f14b66
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
7 changes: 7 additions & 0 deletions app/shell/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LOCAL_DIR := $(GET_LOCAL_DIR)

MODULES += \
lib/console

OBJS += \
$(LOCAL_DIR)/shell.o
37 changes: 37 additions & 0 deletions app/shell/shell.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2009 Travis Geiselbrecht
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <app.h>
#include <debug.h>
#include <lib/console.h>

static void shell_init(const struct _app_descriptor *app, void *args)
{
console_init();
console_start();
}

APP_START(shell)
.entry = shell_init,
.flags = APP_FLAG_BOOT_START | APP_FLAG_THREAD,
APP_END

6 changes: 6 additions & 0 deletions app/stringtests/string_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <debug.h>
#include <string.h>
#include <malloc.h>
#include <app.h>
#include <platform.h>
#include <kernel/thread.h>

Expand Down Expand Up @@ -243,3 +244,8 @@ STATIC_COMMAND_END(stringtests);

#endif

APP_START(stringtests)
.entry = 0,
.flags = 0,
APP_END

2 changes: 0 additions & 2 deletions app/tests/include/app/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#ifndef __APP_TESTS_H
#define __APP_TESTS_H

void tests_init(void);

int thread_tests(void);
void printf_tests(void);

Expand Down
9 changes: 8 additions & 1 deletion app/tests/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <app.h>
#include <debug.h>
#include <app/tests.h>
#include <compiler.h>

Expand All @@ -33,7 +35,12 @@ STATIC_COMMAND_END(tests);

#endif

void tests_init(void)
static void tests_init(const struct _app_descriptor *app, void *args)
{
}

APP_START(tests)
.entry = tests_init,
.flags = APP_FLAG_BOOT_START,
APP_END

0 comments on commit 3f14b66

Please sign in to comment.