add rlogind
via 'telnet hostname 4211' is it possible to establish a connection to a mshell
This commit is contained in:
parent
1d2e3e9be9
commit
42c69cfcfc
3 changed files with 21 additions and 11 deletions
|
@ -209,6 +209,7 @@ int initd(void* arg)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_LWIP
|
#ifdef CONFIG_LWIP
|
||||||
sys_sem_t sem;
|
sys_sem_t sem;
|
||||||
|
char* argv[] = {"/bin/rlogind ", NULL};
|
||||||
|
|
||||||
// Initialize lwIP modules
|
// Initialize lwIP modules
|
||||||
if(sys_sem_new(&sem, 0) != ERR_OK)
|
if(sys_sem_new(&sem, 0) != ERR_OK)
|
||||||
|
@ -228,9 +229,10 @@ int initd(void* arg)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// start echo and/or netio server
|
// start echo, netio and rlogind
|
||||||
echo_init();
|
echo_init();
|
||||||
netio_init();
|
netio_init();
|
||||||
|
create_user_task(NULL, "/bin/rlogind", argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
list_root();
|
list_root();
|
||||||
|
|
|
@ -520,15 +520,17 @@ static int load_task(load_args_t* largs)
|
||||||
|
|
||||||
/* init fildes_table */
|
/* init fildes_table */
|
||||||
spinlock_irqsave_lock(&table_lock);
|
spinlock_irqsave_lock(&table_lock);
|
||||||
task_table[curr_task->id].fildes_table = kmalloc(sizeof(fildes_t)*NR_OPEN);
|
if (!task_table[curr_task->id].fildes_table) {
|
||||||
if (BUILTIN_EXPECT(!task_table[curr_task->id].fildes_table, 0)) {
|
task_table[curr_task->id].fildes_table = kmalloc(sizeof(fildes_t)*NR_OPEN);
|
||||||
spinlock_irqsave_unlock(&table_lock);
|
if (BUILTIN_EXPECT(!task_table[curr_task->id].fildes_table, 0)) {
|
||||||
return -ENOMEM;
|
spinlock_irqsave_unlock(&table_lock);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
memset(task_table[curr_task->id].fildes_table, 0x00, sizeof(fildes_t)*NR_OPEN);
|
||||||
|
task_table[curr_task->id].fildes_table[0].node = findnode_fs("/dev/stdin");
|
||||||
|
task_table[curr_task->id].fildes_table[1].node = findnode_fs("/dev/stdout");
|
||||||
|
task_table[curr_task->id].fildes_table[2].node = findnode_fs("/dev/stderr");
|
||||||
}
|
}
|
||||||
memset(task_table[curr_task->id].fildes_table, 0x00, sizeof(fildes_t)*NR_OPEN);
|
|
||||||
task_table[curr_task->id].fildes_table[0].node = findnode_fs("/dev/stdin");
|
|
||||||
task_table[curr_task->id].fildes_table[1].node = findnode_fs("/dev/stdout");
|
|
||||||
task_table[curr_task->id].fildes_table[2].node = findnode_fs("/dev/stderr");
|
|
||||||
spinlock_irqsave_unlock(&table_lock);
|
spinlock_irqsave_unlock(&table_lock);
|
||||||
|
|
||||||
err = read_fs(file, (uint8_t*)&header, sizeof(elf_header_t));
|
err = read_fs(file, (uint8_t*)&header, sizeof(elf_header_t));
|
||||||
|
|
|
@ -11,7 +11,7 @@ LDFLAGS =
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
all: hello tests jacobi mshell server client
|
all: hello tests jacobi mshell server client rlogind
|
||||||
|
|
||||||
jacobi: jacobi.o
|
jacobi: jacobi.o
|
||||||
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lm
|
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lm
|
||||||
|
@ -37,6 +37,12 @@ mshell: mshell.o
|
||||||
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
||||||
chmod a-x $@.sym
|
chmod a-x $@.sym
|
||||||
|
|
||||||
|
rlogind: rlogind.o
|
||||||
|
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lsocket
|
||||||
|
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||||
|
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
||||||
|
chmod a-x $@.sym
|
||||||
|
|
||||||
server: server.o
|
server: server.o
|
||||||
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lsocket
|
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lsocket
|
||||||
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||||
|
@ -50,7 +56,7 @@ client: client.o
|
||||||
chmod a-x $@.sym
|
chmod a-x $@.sym
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) hello tests server client *.sym *.o *~
|
$(RM) hello tests server client rlogind mshell jacobi hello *.sym *.o *~
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
$(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep
|
$(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep
|
||||||
|
|
Loading…
Add table
Reference in a new issue