From Christian.Klahn at Live.de Sun Feb 6 12:49:08 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:49:08 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:49:28 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:49:28 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:49:49 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:49:49 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:50:32 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:50:32 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:50:59 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:50:59 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:51:27 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:51:27 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:51:44 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:51:44 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:52:32 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:52:32 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:52:50 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:52:50 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:53:13 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:53:13 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:53:28 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:53:28 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 12:53:46 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 12:53:46 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: From Christian.Klahn at Live.de Sun Feb 6 13:11:26 2011 From: Christian.Klahn at Live.de (Christian Klahn) Date: Sun, 6 Feb 2011 13:11:26 +0100 Subject: [tyndur-devel] Nasm lbuilds Message-ID: weitere Nasm Lbuilds From arne.hasselbring at googlemail.com Fri Feb 11 17:48:13 2011 From: arne.hasselbring at googlemail.com (Arne Hasselbring) Date: Fri, 11 Feb 2011 17:48:13 +0100 Subject: [tyndur-devel] [PATCH] strerror Message-ID: <1297442893-17712-1-git-send-email-arne.hasselbring@googlemail.com> + strerror gibt jetzt nicht mehr "Unbekannter Fehler" zurück, sondern die zu errno gehörenden Fehlermeldungen Signed-off-by: Arne Hasselbring --- src/modules/lib/posix/strerror.c | 67 +++++++++++++++++++++++++++++++++++-- 1 files changed, 63 insertions(+), 4 deletions(-) diff --git a/src/modules/lib/posix/strerror.c b/src/modules/lib/posix/strerror.c index e08f3e0..ac3d84e 100644 --- a/src/modules/lib/posix/strerror.c +++ b/src/modules/lib/posix/strerror.c @@ -38,11 +38,70 @@ * * @return Pointer auf internen Buffer mit Fehlermeldung */ + +char *errno_messages[51] = { + "Result too large.", + "Invalid argument.", + "Not enough space.", + "Interrupted function.", + "No such file or directory.", + "File exists.", + "Bad file descriptor.", + "Operation not permitted.", + "I/O error.", + "Cross-device link.", + "Bad address.", + "Argument list too long." + "Not a directory.", + "Permission denied.", + "Too many open files.", + "Executable file format error.", + "No child processes.", + "Resource unavailable, try again.", + "Too many files open in system.", + "Is a directory.", + "No such device.", + "Inappropriate I/O control operation.", + "Mathematics argument out of domain of function.", + "No such device or address.", + "No such process.", + "Broken pipe.", + "Illegal byte sequence.", + + + "Address family not supported.", + "Connection timed out.", + "Protocol wrong type for socket.", + "Connection refused.", + "The socket is not connected.", + "Connection reset.", + "Operation in progress.", + "Connection already in progress.", + "Socket is connected.", + + + "Operation not supported on socket.", + "Read-only file system.", + "No space left on device.", + "Device or resource busy.", + "Value too large to be stored in data type.", + "File too large.", + "Resource deadlock would occur.", + "Address not available.", + "Function not supported.", + "Filename too long.", + "Invalid seek.", + "Too many links.", + "Directory not empty.", + + + "Host is unreachable.", + "Message too large.", + "Protocol error.", +}; + char* strerror(int error_code) { - static char error_message[64]; - snprintf(error_message, sizeof(error_message), - "Unbekannter Fehler %d", error_code); - return error_message; + return errno_messages[error_code - 1]; } -- 1.7.1 From bluecoder at gmx.de Fri Feb 11 19:33:48 2011 From: bluecoder at gmx.de (=?iso-8859-1?q?J=F6rg_Pf=E4hler?=) Date: Fri, 11 Feb 2011 19:33:48 +0100 Subject: [tyndur-devel] [PATCH] strerror In-Reply-To: <1297442893-17712-1-git-send-email-arne.hasselbring@googlemail.com> References: <1297442893-17712-1-git-send-email-arne.hasselbring@googlemail.com> Message-ID: <201102111933.48252.bluecoder@gmx.de> Am Freitag, 11. Februar 2011, um 17:48:13 schrieb Arne Hasselbring: > + strerror gibt jetzt nicht mehr "Unbekannter Fehler" zurück, sondern die > zu errno gehörenden Fehlermeldungen > > Signed-off-by: Arne Hasselbring > --- > src/modules/lib/posix/strerror.c | 67 > +++++++++++++++++++++++++++++++++++-- 1 files changed, 63 insertions(+), 4 > deletions(-) > > diff --git a/src/modules/lib/posix/strerror.c > b/src/modules/lib/posix/strerror.c index e08f3e0..ac3d84e 100644 > --- a/src/modules/lib/posix/strerror.c > +++ b/src/modules/lib/posix/strerror.c > @@ -38,11 +38,70 @@ > * > * @return Pointer auf internen Buffer mit Fehlermeldung > */ > + > +char *errno_messages[51] = { Hier wäre ein MAX_ERRORS-Makro in der Header schöner > + "Result too large.", > + "Invalid argument.", > + "Not enough space.", > + "Interrupted function.", > + "No such file or directory.", > + "File exists.", > + "Bad file descriptor.", > + "Operation not permitted.", > + "I/O error.", > + "Cross-device link.", > + "Bad address.", > + "Argument list too long." > + "Not a directory.", > + "Permission denied.", > + "Too many open files.", > + "Executable file format error.", > + "No child processes.", > + "Resource unavailable, try again.", > + "Too many files open in system.", > + "Is a directory.", > + "No such device.", > + "Inappropriate I/O control operation.", > + "Mathematics argument out of domain of function.", > + "No such device or address.", > + "No such process.", > + "Broken pipe.", > + "Illegal byte sequence.", > + > + > + "Address family not supported.", > + "Connection timed out.", > + "Protocol wrong type for socket.", > + "Connection refused.", > + "The socket is not connected.", > + "Connection reset.", > + "Operation in progress.", > + "Connection already in progress.", > + "Socket is connected.", > + > + > + "Operation not supported on socket.", > + "Read-only file system.", > + "No space left on device.", > + "Device or resource busy.", > + "Value too large to be stored in data type.", > + "File too large.", > + "Resource deadlock would occur.", > + "Address not available.", > + "Function not supported.", > + "Filename too long.", > + "Invalid seek.", > + "Too many links.", > + "Directory not empty.", > + > + > + "Host is unreachable.", > + "Message too large.", > + "Protocol error.", Würde ich lieber als ... [EBLABLA] = "BlaBla", ... machen, das hält besser. > +}; > + > char* strerror(int error_code) > { > - static char error_message[64]; > - snprintf(error_message, sizeof(error_message), > - "Unbekannter Fehler %d", error_code); > - return error_message; > + return errno_messages[error_code - 1]; Und hier dann die -1 entfernen > } From kevin at tyndur.org Fri Feb 11 19:40:10 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Fri, 11 Feb 2011 19:40:10 +0100 Subject: [tyndur-devel] [PATCH] strerror In-Reply-To: <201102111933.48252.bluecoder@gmx.de> References: <1297442893-17712-1-git-send-email-arne.hasselbring@googlemail.com> <201102111933.48252.bluecoder@gmx.de> Message-ID: <20110211184009.GA5442@silvanus> On Fri, Feb 11, 2011 at 07:33:48PM +0100, Jörg Pfähler wrote: > Am Freitag, 11. Februar 2011, um 17:48:13 schrieb Arne Hasselbring: > > + strerror gibt jetzt nicht mehr "Unbekannter Fehler" zurück, sondern die > > zu errno gehörenden Fehlermeldungen > > > > Signed-off-by: Arne Hasselbring > > --- > > src/modules/lib/posix/strerror.c | 67 > > +++++++++++++++++++++++++++++++++++-- 1 files changed, 63 insertions(+), 4 > > deletions(-) > > > > diff --git a/src/modules/lib/posix/strerror.c > > b/src/modules/lib/posix/strerror.c index e08f3e0..ac3d84e 100644 > > --- a/src/modules/lib/posix/strerror.c > > +++ b/src/modules/lib/posix/strerror.c > > @@ -38,11 +38,70 @@ > > * > > * @return Pointer auf internen Buffer mit Fehlermeldung > > */ > > + > > +char *errno_messages[51] = { > Hier wäre ein MAX_ERRORS-Makro in der Header schöner Hm, eigentlich braucht man die Größe doch gar nicht angeben. Ungefähr so gehört das, würde ich sagen: static const char* const errno_messages[] = { [EFOO] = "bar", ... } > > + "Result too large.", > > + "Invalid argument.", > > + "Not enough space.", > > + "Interrupted function.", > > + "No such file or directory.", > > + "File exists.", > > + "Bad file descriptor.", > > + "Operation not permitted.", > > + "I/O error.", > > + "Cross-device link.", > > + "Bad address.", > > + "Argument list too long." > > + "Not a directory.", > > + "Permission denied.", > > + "Too many open files.", > > + "Executable file format error.", > > + "No child processes.", > > + "Resource unavailable, try again.", > > + "Too many files open in system.", > > + "Is a directory.", > > + "No such device.", > > + "Inappropriate I/O control operation.", > > + "Mathematics argument out of domain of function.", > > + "No such device or address.", > > + "No such process.", > > + "Broken pipe.", > > + "Illegal byte sequence.", > > + > > + > > + "Address family not supported.", > > + "Connection timed out.", > > + "Protocol wrong type for socket.", > > + "Connection refused.", > > + "The socket is not connected.", > > + "Connection reset.", > > + "Operation in progress.", > > + "Connection already in progress.", > > + "Socket is connected.", > > + > > + > > + "Operation not supported on socket.", > > + "Read-only file system.", > > + "No space left on device.", > > + "Device or resource busy.", > > + "Value too large to be stored in data type.", > > + "File too large.", > > + "Resource deadlock would occur.", > > + "Address not available.", > > + "Function not supported.", > > + "Filename too long.", > > + "Invalid seek.", > > + "Too many links.", > > + "Directory not empty.", > > + > > + > > + "Host is unreachable.", > > + "Message too large.", > > + "Protocol error.", > Würde ich lieber als > ... > [EBLABLA] = "BlaBla", > ... > machen, das hält besser. > > > +}; > > + > > char* strerror(int error_code) > > { > > - static char error_message[64]; > > - snprintf(error_message, sizeof(error_message), > > - "Unbekannter Fehler %d", error_code); > > - return error_message; > > + return errno_messages[error_code - 1]; > Und hier dann die -1 entfernen Und vor allem prüfen, dass der error_code im Array enthalten ist und du nicht irgendwo ins Leere greifst. Für unerwartete Werte würde ich immer noch "Unbekannter Felder %d" sagen. Kevin From kevin at tyndur.org Fri Feb 11 22:17:09 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Fri, 11 Feb 2011 22:17:09 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_cdi=3A_R=C3=BCckgabewert_von?= =?utf-8?q?_cdi=5Fbios=5Fint10_gefixt?= Message-ID: <1297459029-13473-1-git-send-email-kevin@tyndur.org> ! cdi: vm86_int gibt heutzutage 0/-errno zurück statt true/false Signed-off-by: Kevin Wolf --- src/modules/cdi/lib/bios.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/cdi/lib/bios.c b/src/modules/cdi/lib/bios.c index 8315755..a76b23f 100644 --- a/src/modules/cdi/lib/bios.c +++ b/src/modules/cdi/lib/bios.c @@ -39,8 +39,8 @@ int cdi_bios_int10(struct cdi_bios_registers *registers, cdi_list_t memory) meminfo[1 + i * 3 + 1] = (uint32_t)memarea->src; meminfo[1 + i * 3 + 2] = memarea->size; } - + // BIOS aufrufen - return vm86_int((vm86_regs_t*)registers, meminfo) - 1; + return vm86_int((vm86_regs_t*)registers, meminfo) == 0 ? 0 : -1; } -- 1.6.0.2 From max at tyndur.org Fri Feb 11 22:17:58 2011 From: max at tyndur.org (Max Reitz) Date: Fri, 11 Feb 2011 22:17:58 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=5BPATCH=5D_cdi=3A_R=FCckgabewert_v?= =?iso-8859-1?q?on_cdi=5Fbios=5Fint10_gefixt?= In-Reply-To: <1297459029-13473-1-git-send-email-kevin@tyndur.org> References: <1297459029-13473-1-git-send-email-kevin@tyndur.org> Message-ID: <4D55A786.40808@tyndur.org> Am 11.02.2011 22:17, schrieb Kevin Wolf: > ! cdi: vm86_int gibt heutzutage 0/-errno zurück statt true/false > > Signed-off-by: Kevin Wolf > Acked-by: Max Reitz From kevin at tyndur.org Sat Feb 12 11:03:03 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sat, 12 Feb 2011 11:03:03 +0100 Subject: [tyndur-devel] [PATCH 1/5] kernel2: IRQ-Sharing In-Reply-To: <1296304718-8845-2-git-send-email-max@tyndur.org> References: <1296304718-8845-1-git-send-email-max@tyndur.org> <1296304718-8845-2-git-send-email-max@tyndur.org> Message-ID: <20110212100302.GA5471@silvanus> On Sat, Jan 29, 2011 at 01:38:34PM +0100, max at tyndur.org wrote: > From: Max Reitz > > + Bis zu vier Tasks können jetzt beim Auftreten eines IRQs > benachrichtigt werden. > > Signed-off-by: Max Reitz > --- > src/kernel2/src/interrupts/im.c | 89 ++++++++++++++++++++++++++++---------- > 1 files changed, 65 insertions(+), 24 deletions(-) > > diff --git a/src/kernel2/src/interrupts/im.c b/src/kernel2/src/interrupts/im.c > index d266959..96bfdd9 100644 > --- a/src/kernel2/src/interrupts/im.c > +++ b/src/kernel2/src/interrupts/im.c > @@ -33,6 +33,7 @@ > * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > > +#include > #include > #include > > @@ -51,8 +52,18 @@ extern size_t cpu_count; > /** Einheit: Mikrosekunden */ > uint64_t timer_ticks = 0; > > -static pm_process_t* intr_handling_task[IM_NUM_INTERRUPTS]; > -static uint32_t intr_to_send[IM_NUM_INTERRUPTS]; > +#define MAX_INTERRUPTS 4 > + > +// Wenn mehrere Tasks für einen Interrupt registriert sind, dann werden sie im > +// Array so angeordnet, dass nur die ersten Einträge gefüllt sind > +static pm_process_t* intr_handling_task[IM_NUM_INTERRUPTS][MAX_INTERRUPTS]; > +static uint32_t intr_to_send[IM_NUM_INTERRUPTS][MAX_INTERRUPTS]; > +// Anzahl von Tasks pro Interrupt > +static int intr_num_tasks[IM_NUM_INTERRUPTS]; > +// Gibt an, ob überhaupt irgendein Interrupt für die jeweilige Nummer > +// auszuliefern ist (ist also false, wenn alle intr_to_send-Einträge für den > +// Interrupt 0 sind, sonst true). > +static bool any_intr[IM_NUM_INTERRUPTS]; > > void im_send_interrupts(void); > bool fastrpc_irq(pm_process_t* callee, size_t metadata_size, void* metadata, > @@ -193,7 +204,11 @@ interrupt_stack_frame_t* im_handler(interrupt_stack_frame_t* isf) > // Timer ausloesen, wenn noetig > timer_notify(timer_ticks); > } else { > - intr_to_send[int_num]++; > + int i; > + for (i = 0; i < intr_num_tasks[int_num]; i++) { > + intr_to_send[int_num][i]++; > + } > + any_intr[int_num] = true; > im_disable_irq(int_num - IM_IRQ_BASE); > } > } else if (int_num == 0x30) { > @@ -261,12 +276,25 @@ static void on_process_destroy(pm_process_t* process, void* prv) > panic("im.c: on_process_destroy(): Korrupte Interruptnummer %d", intr); > } > > - if (intr_handling_task[intr] != process) { > - panic("im.c: on_process_destroy(): Prozess nicht fuer Interrupt %d " > - "zustaendig", intr); > + int i, j; > + for (i = 0; i < intr_num_tasks[intr]; i++) { > + if (intr_handling_task[intr][i] == process) { > + intr_handling_task[intr][i] = NULL; > + > + // Nach vorn schieben, sodass immer nur die vorderen Plätze des > + // Arrays belegt sind > + for (j = --intr_num_tasks[intr]; j > i; j--) { > + if (intr_handling_task[intr][j] != NULL) { > + intr_handling_task[intr][i] = intr_handling_task[intr][j]; > + } > + } Bist du dir mit dem Algorithmus sicher? Angenommen wir haben vier Tasks und löschen den ersten: 0 1 2 3, i = 0, j = 3 3 1 2, i = 0, j = 2 -- hier besser aufhören, tun wir aber nicht 2 1 2, i = 0, j = 1 1 1 2, i = 0, j = 0 Ansonsten sieht der Patch in Ordnung aus. From kevin at tyndur.org Sat Feb 12 12:59:17 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sat, 12 Feb 2011 12:59:17 +0100 Subject: [tyndur-devel] [PATCH] kbc: Race zwischen send_kbd_command und IRQ-Handler gefixt Message-ID: <1297511957-5224-1-git-send-email-kevin@tyndur.org> ! kbc: send_kbd_command wartet auf ein ACK von der Tastatur. Wenn die Tastatur aber ein ACK sendet, löst sie auch einen IRQ aus, und der IRQ-Handler kann das ACK klauen, so dass send_kbd_command ewig wartet. Signed-off-by: Kevin Wolf --- src/modules/kbc/keyboard.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/modules/kbc/keyboard.c b/src/modules/kbc/keyboard.c index bfacf01..89664a8 100644 --- a/src/modules/kbc/keyboard.c +++ b/src/modules/kbc/keyboard.c @@ -85,11 +85,13 @@ static void send_key_event(uint8_t keycode, bool release); */ static void send_kbd_command(uint8_t command) { + p(); while (inb(0x64) & 0x2) { yield(); } outb(0x60, command); while (inb(0x60) != 0xfa); + v(); } -- 1.6.0.2 From max at tyndur.org Sat Feb 12 13:57:32 2011 From: max at tyndur.org (max at tyndur.org) Date: Sat, 12 Feb 2011 13:57:32 +0100 Subject: [tyndur-devel] [PATCH 1/5 v2] kernel2: IRQ-Sharing Message-ID: <1297515452-8041-1-git-send-email-max@tyndur.org> From: Max Reitz + Bis zu vier Tasks können jetzt beim Auftreten eines IRQs benachrichtigt werden. Signed-off-by: Max Reitz --- src/kernel2/src/interrupts/im.c | 87 ++++++++++++++++++++++++++++----------- 1 files changed, 63 insertions(+), 24 deletions(-) diff --git a/src/kernel2/src/interrupts/im.c b/src/kernel2/src/interrupts/im.c index cdb3199..18e11ef 100644 --- a/src/kernel2/src/interrupts/im.c +++ b/src/kernel2/src/interrupts/im.c @@ -33,6 +33,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include @@ -51,8 +52,18 @@ extern size_t cpu_count; /** Einheit: Mikrosekunden */ uint64_t timer_ticks = 0; -static pm_process_t* intr_handling_task[IM_NUM_INTERRUPTS]; -static uint32_t intr_to_send[IM_NUM_INTERRUPTS]; +#define MAX_INTERRUPTS 4 + +// Wenn mehrere Tasks für einen Interrupt registriert sind, dann werden sie im +// Array so angeordnet, dass nur die ersten Einträge gefüllt sind +static pm_process_t* intr_handling_task[IM_NUM_INTERRUPTS][MAX_INTERRUPTS]; +static uint32_t intr_to_send[IM_NUM_INTERRUPTS][MAX_INTERRUPTS]; +// Anzahl von Tasks pro Interrupt +static int intr_num_tasks[IM_NUM_INTERRUPTS]; +// Gibt an, ob überhaupt irgendein Interrupt für die jeweilige Nummer +// auszuliefern ist (ist also false, wenn alle intr_to_send-Einträge für den +// Interrupt 0 sind, sonst true). +static bool any_intr[IM_NUM_INTERRUPTS]; void im_send_interrupts(void); bool fastrpc_irq(pm_process_t* callee, size_t metadata_size, void* metadata, @@ -193,7 +204,11 @@ interrupt_stack_frame_t* im_handler(interrupt_stack_frame_t* isf) // Timer ausloesen, wenn noetig timer_notify(timer_ticks); } else { - intr_to_send[int_num]++; + int i; + for (i = 0; i < intr_num_tasks[int_num]; i++) { + intr_to_send[int_num][i]++; + } + any_intr[int_num] = true; im_disable_irq(int_num - IM_IRQ_BASE); } } else if (int_num == 0x30) { @@ -261,12 +276,23 @@ static void on_process_destroy(pm_process_t* process, void* prv) panic("im.c: on_process_destroy(): Korrupte Interruptnummer %d", intr); } - if (intr_handling_task[intr] != process) { - panic("im.c: on_process_destroy(): Prozess nicht fuer Interrupt %d " - "zustaendig", intr); + int i, j; + for (i = 0; i < intr_num_tasks[intr]; i++) { + if (intr_handling_task[intr][i] == process) { + // Nach vorn schieben, sodass immer nur die vorderen Plätze des + // Arrays belegt sind + int last = --intr_num_tasks[intr]; + for (j = i + 1; j <= last; j++) { + intr_handling_task[intr][j - 1] = intr_handling_task[intr][j]; + } + intr_handling_task[intr][last] = NULL; + + return; + } } - intr_handling_task[intr] = NULL; + panic("im.c: on_process_destroy(): Prozess nicht fuer Interrupt %d " + "zustaendig", intr); } /** @@ -280,16 +306,21 @@ static void on_process_destroy(pm_process_t* process, void* prv) */ bool im_add_handler(uint32_t intr, pm_process_t* handler) { - if ((intr >= IM_NUM_INTERRUPTS) || intr_handling_task[intr]) { + if (intr >= IM_NUM_INTERRUPTS) { return false; } - intr_handling_task[intr] = handler; + if (intr_num_tasks[intr] >= MAX_INTERRUPTS) { + // Kein Platz für diesen IRQ mehr übrig + return false; + } + + intr_handling_task[intr][intr_num_tasks[intr]++] = handler; pm_register_on_destroy(handler, on_process_destroy, (void*) intr); // Moeglicherweise ist der IRQ frueher maskiert worden, weil es keinen // Treiber dafuer gab. Spaetestens jetzt brauchen wir ihn aber wieder. - if ((intr >= IM_IRQ_BASE) && (intr< (IM_IRQ_BASE + 16))) { + if ((intr >= IM_IRQ_BASE) && (intr < (IM_IRQ_BASE + 16))) { im_enable_irq(intr - IM_IRQ_BASE); } @@ -307,23 +338,31 @@ void im_send_interrupts(void) for (intr = 0; intr < IM_NUM_INTERRUPTS; intr++) { - while (intr_to_send[intr] > 0) { - if (intr_handling_task[intr] == NULL) { - intr_to_send[intr] = 0; - break; - } + if (!any_intr[intr]) { + continue; + } - // Dieses Wechseln des Tasks ist wichtig: IRQs werden nur - // angenommen, wenn der Task sie sich selbst schickt - current_thread = new_thread = - list_get_element_at(intr_handling_task[intr]->threads, 0); + any_intr[intr] = false; + + int i; + for (i = 0; i < intr_num_tasks[intr]; i++) { + while (intr_to_send[intr][i] > 0) { + // Dieses Wechseln des Tasks ist wichtig: IRQs werden nur + // angenommen, wenn der Task sie sich selbst schickt + current_thread = new_thread = + list_get_element_at(intr_handling_task[intr][i]->threads, 0); + + if (!fastrpc_irq(intr_handling_task[intr][i], 0, 0, + sizeof(intr), (char*) &intr, intr - IM_IRQ_BASE)) + { + break; + } + intr_to_send[intr][i]--; + } - if (!fastrpc_irq(intr_handling_task[intr], 0, 0, - sizeof(intr), (char*) &intr, intr - IM_IRQ_BASE)) - { - break; + if (intr_to_send[intr][i]) { + any_intr[intr] = true; } - intr_to_send[intr]--; } } -- 1.7.1 From max at tyndur.org Sat Feb 12 14:08:01 2011 From: max at tyndur.org (Max Reitz) Date: Sat, 12 Feb 2011 14:08:01 +0100 Subject: [tyndur-devel] [PATCH] kbc: Race zwischen send_kbd_command und IRQ-Handler gefixt In-Reply-To: <1297511957-5224-1-git-send-email-kevin@tyndur.org> References: <1297511957-5224-1-git-send-email-kevin@tyndur.org> Message-ID: <4D568631.5030400@tyndur.org> Am 12.02.2011 12:59, schrieb Kevin Wolf: > ! kbc: send_kbd_command wartet auf ein ACK von der Tastatur. Wenn die > Tastatur aber ein ACK sendet, löst sie auch einen IRQ aus, und der > IRQ-Handler kann das ACK klauen, so dass send_kbd_command ewig wartet. > > Signed-off-by: Kevin Wolf > Acked-by: Max Reitz From shyxormz at asxsoft.de Sun Feb 13 00:57:05 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Sun, 13 Feb 2011 00:57:05 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_Englische_=C3=9Cbersetzung_f?= =?utf-8?q?=C3=BCr_servmgr?= Message-ID: <1297555025-20606-1-git-send-email-shyxormz@asxsoft.de> Signed-off-by: Patrick Pokatilo --- src/modules/servmgr/Makefile.all | 2 +- src/modules/servmgr/config.c | 13 ++++-- src/modules/servmgr/lang/Makefile.conf | 1 + src/modules/servmgr/lang/lang_en.c | 70 ++++++++++++++++++++++++++++++++ src/modules/servmgr/lang/resstr.h | 42 +++++++++++++++++++ src/modules/servmgr/main.c | 11 ++++- src/modules/servmgr/service.c | 13 ++++-- 7 files changed, 139 insertions(+), 13 deletions(-) create mode 100644 src/modules/servmgr/lang/Makefile.conf create mode 100644 src/modules/servmgr/lang/lang_en.c create mode 100644 src/modules/servmgr/lang/resstr.h diff --git a/src/modules/servmgr/Makefile.all b/src/modules/servmgr/Makefile.all index 59b7be6..39630b1 100644 --- a/src/modules/servmgr/Makefile.all +++ b/src/modules/servmgr/Makefile.all @@ -2,5 +2,5 @@ shopt -s extglob source $LOST_BUILDMK_ROOT/config.sh echo "LD $1/modules/servmgr" -$LOST_TOOLS_LD $LDSCRIPT -oservmgr.mod *.o --start-group $2 --end-group +$LOST_TOOLS_LD $LDSCRIPT -oservmgr.mod *.o lang/*.o --start-group $2 --end-group $LOST_TOOLS_STRIP -s servmgr.mod -o $1/modules/servmgr diff --git a/src/modules/servmgr/config.c b/src/modules/servmgr/config.c index 2280e00..434eacc 100644 --- a/src/modules/servmgr/config.c +++ b/src/modules/servmgr/config.c @@ -45,6 +45,9 @@ #include #include "servmgr.h" +#define TMS_MODULE config +#include + static list_t* config_list; char* full_config_path; @@ -159,9 +162,9 @@ static void config_parse_deps(const char* path, dep = config_service_get(buffer); if (dep == NULL) { - printf("servmgr: Service %s haengt ab von %s; Dieser ist aber " - "nicht vorhanden in der Konfiguration!\n", conf_serv->name, - buffer); + printf(TMS(service_depends, "servmgr: Service '%s' haengt ab von" + "'%s'; Dieser ist aber nicht vorhanden in der" + "Konfiguration!\n"), conf_serv->name, buffer); continue; } @@ -286,8 +289,8 @@ bool config_read() // Verzeichnis mit der Konfiguration oeffnen dir = directory_open(full_config_path); if (!dir) { - printf("servmgr: Konnte Konfigurationsverzeichnis nicht oeffnen: '%s'" - "\n", full_config_path); + printf(TMS(dir_open, "servmgr: Konnte Konfigurationsverzeichnis nicht" + "oeffnen: '%s'\n"), full_config_path); return false; } diff --git a/src/modules/servmgr/lang/Makefile.conf b/src/modules/servmgr/lang/Makefile.conf new file mode 100644 index 0000000..594ef2a --- /dev/null +++ b/src/modules/servmgr/lang/Makefile.conf @@ -0,0 +1 @@ +CC_FLAGS_APPEND="-Wno-missing-braces" diff --git a/src/modules/servmgr/lang/lang_en.c b/src/modules/servmgr/lang/lang_en.c new file mode 100644 index 0000000..11ed0b0 --- /dev/null +++ b/src/modules/servmgr/lang/lang_en.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2009 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Kevin Wolf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "resstr.h" + +static int get_number(int n) +{ + return (n == 1 ? 0 : 1); +} + +static const struct tms_strings dict[] = { + &__tms_config_service_depends, + "servmgr: service '%s' depends on '%s', which is not present in the configuration!\n", + + &__tms_config_dir_open, + "servmgr: could not open configuration directory: '%s'\n", + + &__tms_main_usage, + "usage: servmgr [startup services ...]", + + &__tms_main_not_running, + "service '%s' is not running!\n", + + &__tms_service_not_found, + "servmgr: service not found: '%s'\n", + + &__tms_service_dependency, + "servmgr: could not resolve dependency on '%s'. Thus, '%s' can not be started.\n", + + &__tms_service_timeout, + "servmgr: timeout while waiting for service '%s'\n", + + 0, + 0, +}; + +static const struct tms_lang lang = { + .lang = "en", + .numbers = 2, + .get_number = get_number, + .strings = dict, +}; + +LANGUAGE(&lang) diff --git a/src/modules/servmgr/lang/resstr.h b/src/modules/servmgr/lang/resstr.h new file mode 100644 index 0000000..8c6d536 --- /dev/null +++ b/src/modules/servmgr/lang/resstr.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2009 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Kevin Wolf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL; + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY; + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RESSTR_H +#define RESSTR_H + +extern void* __tms_config_service_depends; +extern void* __tms_config_dir_open; + +extern void* __tms_main_usage; +extern void* __tms_main_not_running; + +extern void* __tms_service_not_found; +extern void* __tms_service_dependency; +extern void* __tms_service_timeout; + +#endif diff --git a/src/modules/servmgr/main.c b/src/modules/servmgr/main.c index a432208..87bd280 100644 --- a/src/modules/servmgr/main.c +++ b/src/modules/servmgr/main.c @@ -43,6 +43,9 @@ #include "servmgr.h" +#define TMS_MODULE main +#include + bool service_running(const char* name); bool service_wait(const char* name, uint32_t timeout); @@ -80,8 +83,8 @@ static void parse_params(int argc, char* argv[]) list_push(startup_services, argv[i]); } } else { - puts("Aufruf: servmgr " - "[Startup-Services ...]"); + puts(TMS(usage, "Aufruf: servmgr " + "[Startup-Services ...]")); exit(-1); } } @@ -127,7 +130,7 @@ static void failed_startup_services(void) int i; for (i = 0; (service = list_get_element_at(startup_services, i)); i++) { - printf("Service '%s' laeuft nicht!\n", service); + printf(TMS(not_running, "Service '%s' laeuft nicht!\n"), service); } } @@ -140,6 +143,8 @@ static void failed_startup_services(void) */ int main(int argc, char* argv[]) { + tms_init(); + // Parameter verarbeiten parse_params(argc, argv); diff --git a/src/modules/servmgr/service.c b/src/modules/servmgr/service.c index 65e9f5d..a416ddb 100644 --- a/src/modules/servmgr/service.c +++ b/src/modules/servmgr/service.c @@ -42,6 +42,9 @@ #include "servmgr.h" +#define TMS_MODULE service +#include + /** * Pid eines Services anhand seines Namens finden * @@ -107,15 +110,16 @@ bool service_start(const char* name) } if (!conf_serv) { - printf("servmgr: Service nicht gefunden: %s\n", name); + printf(TMS(not_found, "servmgr: Service nicht gefunden: %s\n"), name); return false; } // Abhaengigkeiten starten for (i = 0; (dep = list_get_element_at(conf_serv->deps, i)); i++) { if (!service_start(dep->name)) { - printf("servmgr: Konnte die Abhaengigkeit von %s nicht erfuellen. " - "%s kann deshalb nicht gestartet werden.\n", dep->name, name); + printf(TMS(dependency, "servmgr: Konnte die Abhaengigkeit von %s " + "nicht erfuellen. %s kann deshalb nicht gestartet werden.\n"), + dep->name, name); return false; } } @@ -123,7 +127,8 @@ bool service_start(const char* name) if (conf_serv->start_cmd) { pid_t pid = init_execute(conf_serv->start_cmd); if ((conf_serv->conf.wait == SERVSTART) && !service_wait(name, 10000)) { - printf("servmgr: Timeout beim Warten auf den Service %s\n", name); + printf(TMS(timeout, "servmgr: Timeout beim Warten auf den " + "Service %s\n"), name); return false; } else if (conf_serv->conf.wait == TERMINATE) { int status; -- 1.7.0.4 From shyxormz at asxsoft.de Sun Feb 13 01:29:47 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Sun, 13 Feb 2011 01:29:47 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_Englische_=C3=9Cbersetzung_f?= =?utf-8?b?w7xyIGJ1aWxk?= Message-ID: <1297556987-6228-1-git-send-email-shyxormz@asxsoft.de> Signed-off-by: Patrick Pokatilo --- src/modules/c/build/Makefile.all | 2 +- src/modules/c/build/build.c | 18 +++++-- src/modules/c/build/dir.c | 7 ++- src/modules/c/build/lang/Makefile.conf | 1 + src/modules/c/build/lang/lang_en.c | 82 ++++++++++++++++++++++++++++++++ src/modules/c/build/lang/resstr.h | 46 ++++++++++++++++++ src/modules/c/build/main.c | 13 +++-- 7 files changed, 155 insertions(+), 14 deletions(-) create mode 100644 src/modules/c/build/lang/Makefile.conf create mode 100644 src/modules/c/build/lang/lang_en.c create mode 100644 src/modules/c/build/lang/resstr.h diff --git a/src/modules/c/build/Makefile.all b/src/modules/c/build/Makefile.all index 9c2a821..8cf0dd7 100644 --- a/src/modules/c/build/Makefile.all +++ b/src/modules/c/build/Makefile.all @@ -3,5 +3,5 @@ source $LOST_BUILDMK_ROOT/config.sh echo "LD $1/apps/build" -$LOST_TOOLS_LD -obuild $LDSCRIPT *.o --start-group $2 --end-group +$LOST_TOOLS_LD -obuild $LDSCRIPT *.o lang/*.o --start-group $2 --end-group $LOST_TOOLS_STRIP -s build -o $1/apps/build diff --git a/src/modules/c/build/build.c b/src/modules/c/build/build.c index 9c340f0..cbc00e3 100644 --- a/src/modules/c/build/build.c +++ b/src/modules/c/build/build.c @@ -41,6 +41,9 @@ #include "build.h" +#define TMS_MODULE build +#include + #ifdef __LINUX__ static const char* cflags = "-m32 -g -O0 -Wall -fno-stack-protector -nostdinc" " -fno-leading-underscore -fno-omit-frame-pointer -fno-strict-aliasing" @@ -230,19 +233,22 @@ static void do_build(struct build_dir* dir, const char* parent_include, // Und schliesslich noch die einzelnen Dateien // TODO Pruefen, ob sich Abhaengigkeiten veraendert haben if (!dont_compile) { - printf("%s: Kompilieren (C)...", dir->path); + printf(TMS(compile_c, "%s: Kompilieren (C)..."), dir->path); fflush(stdout); compile(dir->path, dir->src_files[LANG_C], c_compiler, cflags, include); - printf("\r%s: Kompilieren (Pascal)...\033[K", dir->path); + printf(TMS(compile_pascal, "\r%s: Kompilieren (Pascal)...\033[K"), + dir->path); fflush(stdout); compile(dir->path, dir->src_files[LANG_PAS], "fpc", fpcflags, include); - printf("\r%s: Assemblieren (gas)...\033[K", dir->path); + printf(TMS(assemble_gas, "\r%s: Assemblieren (gas)...\033[K"), + dir->path); fflush(stdout); compile(dir->path, dir->src_files[LANG_ASM_GAS], "gcc", gasflags, include); - printf("\r%s: Assemblieren (yasm)...\033[K", dir->path); + printf(TMS(assemble_yasm, "\r%s: Assemblieren (yasm)...\033[K"), + dir->path); fflush(stdout); for (i = 0; (file = list_get_element_at(dir->src_files[LANG_ASM_NASM], i)); i++) { do_command(dir->path, "yasm", "%s %s", nasmflags, file->name); @@ -251,7 +257,7 @@ static void do_build(struct build_dir* dir, const char* parent_include, // Im Wurzelverzeichnis wird gelinkt (TODO einstellbar machen) if (dir->parent == NULL) { - printf("\r%s: Linken...\033[K", dir->path); + printf(TMS(link, "\r%s: Linken...\033[K"), dir->path); fflush(stdout); objs = get_obj_files(dir->path); @@ -289,6 +295,6 @@ void build(struct build_dir* root) } root_path = getcwd(NULL, 0); do_build(root, "", "", 0); - printf("Fertig gebaut.\n"); + printf(TMS(done, "Fertig gebaut.\n")); free(root_path); } diff --git a/src/modules/c/build/dir.c b/src/modules/c/build/dir.c index b77c467..fbe790c 100644 --- a/src/modules/c/build/dir.c +++ b/src/modules/c/build/dir.c @@ -41,6 +41,9 @@ #include "build.h" +#define TMS_MODULE dir +#include + /** * Durchsucht ein Verzeichnis und speichert alle fuer das Bauen noetige * Informationen in dynamisch allozierten Datenstrukturen, die vom Aufrufer @@ -70,8 +73,8 @@ struct build_dir* scan_directory(struct build_dir* parent, const char* path) int ignorenobuild = 0; if (dir == NULL) { - fprintf(stderr, "Verzeichnis %s kann nicht geoeffnet werden.\n", - path); + fprintf(stderr, TMS(not_open, "Verzeichnis %s kann nicht geoeffnet" + "werden.\n"), path); return NULL; } diff --git a/src/modules/c/build/lang/Makefile.conf b/src/modules/c/build/lang/Makefile.conf new file mode 100644 index 0000000..594ef2a --- /dev/null +++ b/src/modules/c/build/lang/Makefile.conf @@ -0,0 +1 @@ +CC_FLAGS_APPEND="-Wno-missing-braces" diff --git a/src/modules/c/build/lang/lang_en.c b/src/modules/c/build/lang/lang_en.c new file mode 100644 index 0000000..33935a3 --- /dev/null +++ b/src/modules/c/build/lang/lang_en.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2011 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Patrick Pokatilo. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "resstr.h" + +static int get_number(int n) +{ + return (n == 1 ? 0 : 1); +} + +static const struct tms_strings dict[] = { + &__tms_build_compile_c, + "%s: compiling (C)...", + + &__tms_build_compile_pascal, + "\r%s: compiling (pascal)...\033[K", + + &__tms_build_assemble_gas, + "\r%s: assembling (gas)...\033[K", + + &__tms_build_assemble_yasm, + "\r%s: assembling (yasm)...\033[K", + + &__tms_build_link, + "\r%s: linking...\033[K", + + &__tms_build_done, + "Build complete.\n", + + &__tms_dir_not_open, + "Can't open directory '%s'.\n", + + &__tms_main_usage, + "Usage: %s [-k] [-nc] [-v] [--dry-run] []\n", + + &__tms_main_dir_not_found, + "Directory not found\n", + + &__tms_main_dir_not_found_again, + "Directory not found\n", + + &__tms_main_runtime, + "Runtime: %lld sec. %lld msec.\n", + + 0, + 0, +}; + +static const struct tms_lang lang = { + .lang = "en", + .numbers = 2, + .get_number = get_number, + .strings = dict, +}; + +LANGUAGE(&lang) diff --git a/src/modules/c/build/lang/resstr.h b/src/modules/c/build/lang/resstr.h new file mode 100644 index 0000000..7fd6752 --- /dev/null +++ b/src/modules/c/build/lang/resstr.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2011 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Patrick Pokatilo. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL; + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY; + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RESSTR_H +#define RESSTR_H + +extern void* __tms_build_compile_c; +extern void* __tms_build_compile_pascal; +extern void* __tms_build_assemble_gas; +extern void* __tms_build_assemble_yasm; +extern void* __tms_build_link; +extern void* __tms_build_done; + +extern void* __tms_dir_not_open; + +extern void* __tms_main_usage; +extern void* __tms_main_dir_not_found; +extern void* __tms_main_dir_not_found_again; +extern void* __tms_main_runtime; + +#endif diff --git a/src/modules/c/build/main.c b/src/modules/c/build/main.c index 8997abe..bcd6920 100644 --- a/src/modules/c/build/main.c +++ b/src/modules/c/build/main.c @@ -41,6 +41,9 @@ #include "build.h" +#define TMS_MODULE main +#include + /** * Legt Kuerzel fuer Dateitypen fest, die fuer die Anzeige benutzt werden * koennen, waehrend die Datei verarbeitet wird @@ -79,8 +82,8 @@ int standalone = 0; static void usage(char* binary) { - fprintf(stderr, "Aufruf: %s [-k] [-nc] [-v] [--dry-run] []\n", - binary); + fprintf(stderr, TMS(usage, "Aufruf: %s [-k] [-nc] [-v] [--dry-run] " + "[]\n"), binary); exit(1); } @@ -117,7 +120,7 @@ int main(int argc, char** argv) // Ins Wurzelverzeichnis des Projekts wechseln if (rootdir_path) { if (chdir(argv[i])) { - fprintf(stderr, "Verzeichnis nicht gefunden\n"); + fprintf(stderr, TMS(dir_not_found, "Verzeichnis nicht gefunden\n")); return 1; } } @@ -125,7 +128,7 @@ int main(int argc, char** argv) // Alle zu kompilierenden Dateien, Includeverzeichnisse usw. erfassen rootdir = scan_directory(NULL, "."); if (rootdir == NULL) { - fprintf(stderr, "Verzeichnis nicht gefunden\n"); + fprintf(stderr, TMS(dir_not_found_again, "Verzeichnis nicht gefunden\n")); return 1; } @@ -138,6 +141,6 @@ int main(int argc, char** argv) msecs = (get_tick_count() - start_time) / 1000; secs = msecs / 1000; msecs -= secs * 1000; - printf("Laufzeit: %lld Sec. %lld Msec.\n", secs, msecs); + printf(TMS(runtime, "Laufzeit: %lld Sec. %lld Msec.\n"), secs, msecs); return 0; } -- 1.7.0.4 From shyxormz at asxsoft.de Sun Feb 13 02:12:48 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Sun, 13 Feb 2011 02:12:48 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_Mehrfachvergabe_von_Symbolna?= =?utf-8?q?men_f=C3=BCr_TMS?= Message-ID: <1297559568-3455-1-git-send-email-shyxormz@asxsoft.de> * Wenn das Symbol bereits vergeben wurde, ignoriert TMS den Eintrag, im Endeffekt wird also der bereits vorhande String genutzt. Die Meldung "ignoring symbol 'TMS_SNAME(sym)' due to duplication" wird ausgegeben, um auf ein eventuell versehentliches Verwenden eines bereits benutzten Symbols hinzuweisen. Signed-off-by: Patrick Pokatilo --- src/modules/include/tms.h | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/include/tms.h b/src/modules/include/tms.h index 7e46c9d..4de11ed 100644 --- a/src/modules/include/tms.h +++ b/src/modules/include/tms.h @@ -76,11 +76,15 @@ struct tms_lang { #define TMS(sym, string) \ ({ \ asm volatile( \ - ".section tmsstring,\"aw\", at progbits\n" \ - ".global " TMS_SNAME(sym) "\n" \ - TMS_SNAME(sym)":\n"\ - ".int %P0\n" \ - ".section .text" : : "i" (string)); \ + ".ifndef " TMS_SNAME(sym) "\n\t" \ + ".section tmsstring,\"aw\", at progbits\n\t" \ + ".global " TMS_SNAME(sym) "\n\t" \ + TMS_SNAME(sym)":\n\t"\ + ".int %P0\n\t" \ + ".section .text\n\t" \ + ".else\n\t" \ + ".print \"ignoring symbol '" TMS_SNAME(sym) "' due to duplication\\n\"\n\t" \ + ".endif\n" : : "i" (string)); \ extern const char* TMS_NAME(sym); \ TMS_NAME(sym); \ }) -- 1.7.0.4 From shyxormz at asxsoft.de Sun Feb 13 14:18:10 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Sun, 13 Feb 2011 14:18:10 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH_v2=5D_Mehrfachvergabe_von_Symbo?= =?utf-8?q?lnamen_f=C3=BCr_TMS?= In-Reply-To: <1297559568-3455-1-git-send-email-shyxormz@asxsoft.de> References: <1297559568-3455-1-git-send-email-shyxormz@asxsoft.de> Message-ID: <1297603090-13105-1-git-send-email-shyxormz@asxsoft.de> * Wenn das Symbol bereits vergeben wurde, ignoriert TMS den Eintrag, im Endeffekt wird also der bereits vorhande String genutzt. Die Strings werden anhand ihrer Namen (z.B. .LC0) verglichen, sind sie nicht identisch, so wird eine Fehlermeldung ausgegeben. Signed-off-by: Patrick Pokatilo --- src/modules/include/tms.h | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/include/tms.h b/src/modules/include/tms.h index 4de11ed..fb6eaac 100644 --- a/src/modules/include/tms.h +++ b/src/modules/include/tms.h @@ -76,14 +76,17 @@ struct tms_lang { #define TMS(sym, string) \ ({ \ asm volatile( \ - ".ifndef " TMS_SNAME(sym) "\n\t" \ - ".section tmsstring,\"aw\", at progbits\n\t" \ + ".ifndef "TMS_SNAME(sym)"\n\t" \ + ".pushsection tmsstring,\"aw\", at progbits\n\t" \ + ".set "TMS_SNAME(sym)"_string, %P0\n\t" \ ".global " TMS_SNAME(sym) "\n\t" \ TMS_SNAME(sym)":\n\t"\ ".int %P0\n\t" \ - ".section .text\n\t" \ + ".popsection\n\t" \ ".else\n\t" \ - ".print \"ignoring symbol '" TMS_SNAME(sym) "' due to duplication\\n\"\n\t" \ + ".if "TMS_SNAME(sym)"_string != %P0\n\t" \ + ".error \"TMS: Mehrfachdefinition des Symbols '"TMS_SNAME(sym)"' mit verschiedenen Strings\\n\"\n\t" \ + ".endif\n\t" \ ".endif\n" : : "i" (string)); \ extern const char* TMS_NAME(sym); \ TMS_NAME(sym); \ -- 1.7.0.4 From kevin at tyndur.org Sun Feb 13 20:47:31 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 13 Feb 2011 20:47:31 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_cdi/audio=3A_RPC-Daten_pr?= =?utf-8?b?w7xlZmVu?= Message-ID: <1297626451-7694-1-git-send-email-kevin@tyndur.org> ! cdi/audio: RPC(is_playback_device) sollte prüfen, ob auch wirklich ein gültiges Gerät angefordert worden ist, sonst könnte es rot geben. Signed-off-by: Kevin Wolf --- src/modules/cdi/lib/audio.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/modules/cdi/lib/audio.c b/src/modules/cdi/lib/audio.c index 7618c42..3ffb8f9 100644 --- a/src/modules/cdi/lib/audio.c +++ b/src/modules/cdi/lib/audio.c @@ -124,6 +124,11 @@ RPC(is_playback_device) struct cdi_audio_device* dev = cdi_list_get(adriver->drv.devices, ((int*) data)[0]); + if (dev == NULL) { + rpc_int_resp(-1); + return; + } + rpc_int_resp(!dev->record); } -- 1.6.0.2 From max at tyndur.org Sun Feb 13 20:50:59 2011 From: max at tyndur.org (Max Reitz) Date: Sun, 13 Feb 2011 20:50:59 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=5BPATCH=5D_cdi/audio=3A_RPC-Daten_?= =?iso-8859-1?q?pr=FCefen?= In-Reply-To: <1297626451-7694-1-git-send-email-kevin@tyndur.org> References: <1297626451-7694-1-git-send-email-kevin@tyndur.org> Message-ID: <4D583623.8080803@tyndur.org> Am 13.02.2011 20:47, schrieb Kevin Wolf: > ! cdi/audio: RPC(is_playback_device) sollte prüfen, ob auch wirklich ein > gültiges Gerät angefordert worden ist, sonst könnte es rot geben. > > Signed-off-by: Kevin Wolf > Acked-by: Max Reitz From kevin at tyndur.org Sun Feb 13 23:03:39 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Sun, 13 Feb 2011 23:03:39 +0100 Subject: [tyndur-devel] [PATCH] kernel2: amd64: Tippfehler in Fehlermeldung korrigiert Message-ID: <1297634619-14095-1-git-send-email-kevin@tyndur.org> ! kernel2: Es heißt "Multiboot", nicht "Modultiboot" Signed-off-by: Kevin Wolf --- src/kernel2/src/arch/amd64/loader/startup.S | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/kernel2/src/arch/amd64/loader/startup.S b/src/kernel2/src/arch/amd64/loader/startup.S index 80c511a..6a620de 100644 --- a/src/kernel2/src/arch/amd64/loader/startup.S +++ b/src/kernel2/src/arch/amd64/loader/startup.S @@ -200,7 +200,7 @@ .section .data error_msg_no_multiboot: - .ascii "Im Moment wird ein Modultiboot-Bootloader vorausgesetzt" + .ascii "Im Moment wird ein Multiboot-Bootloader vorausgesetzt" .byte 0 error_msg_no_longmode: -- 1.6.0.2 From shyxormz at asxsoft.de Mon Feb 14 12:34:24 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Mon, 14 Feb 2011 12:34:24 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH_v2=5D_Englische_=C3=9Cbersetzun?= =?utf-8?q?g_f=C3=BCr_servmgr?= In-Reply-To: <1297555025-20606-1-git-send-email-shyxormz@asxsoft.de> References: <1297555025-20606-1-git-send-email-shyxormz@asxsoft.de> Message-ID: <1297683264-22782-1-git-send-email-shyxormz@asxsoft.de> Signed-off-by: Patrick Pokatilo --- src/modules/servmgr/Makefile.all | 2 +- src/modules/servmgr/config.c | 13 ++++-- src/modules/servmgr/lang/Makefile.conf | 1 + src/modules/servmgr/lang/lang_en.c | 70 ++++++++++++++++++++++++++++++++ src/modules/servmgr/lang/resstr.h | 42 +++++++++++++++++++ src/modules/servmgr/main.c | 11 ++++- src/modules/servmgr/service.c | 13 ++++-- 7 files changed, 139 insertions(+), 13 deletions(-) create mode 100644 src/modules/servmgr/lang/Makefile.conf create mode 100644 src/modules/servmgr/lang/lang_en.c create mode 100644 src/modules/servmgr/lang/resstr.h diff --git a/src/modules/servmgr/Makefile.all b/src/modules/servmgr/Makefile.all index 59b7be6..39630b1 100644 --- a/src/modules/servmgr/Makefile.all +++ b/src/modules/servmgr/Makefile.all @@ -2,5 +2,5 @@ shopt -s extglob source $LOST_BUILDMK_ROOT/config.sh echo "LD $1/modules/servmgr" -$LOST_TOOLS_LD $LDSCRIPT -oservmgr.mod *.o --start-group $2 --end-group +$LOST_TOOLS_LD $LDSCRIPT -oservmgr.mod *.o lang/*.o --start-group $2 --end-group $LOST_TOOLS_STRIP -s servmgr.mod -o $1/modules/servmgr diff --git a/src/modules/servmgr/config.c b/src/modules/servmgr/config.c index 2280e00..434eacc 100644 --- a/src/modules/servmgr/config.c +++ b/src/modules/servmgr/config.c @@ -45,6 +45,9 @@ #include #include "servmgr.h" +#define TMS_MODULE config +#include + static list_t* config_list; char* full_config_path; @@ -159,9 +162,9 @@ static void config_parse_deps(const char* path, dep = config_service_get(buffer); if (dep == NULL) { - printf("servmgr: Service %s haengt ab von %s; Dieser ist aber " - "nicht vorhanden in der Konfiguration!\n", conf_serv->name, - buffer); + printf(TMS(service_depends, "servmgr: Service '%s' haengt ab von " + "'%s'; Dieser ist aber nicht vorhanden in der " + "Konfiguration!\n"), conf_serv->name, buffer); continue; } @@ -286,8 +289,8 @@ bool config_read() // Verzeichnis mit der Konfiguration oeffnen dir = directory_open(full_config_path); if (!dir) { - printf("servmgr: Konnte Konfigurationsverzeichnis nicht oeffnen: '%s'" - "\n", full_config_path); + printf(TMS(dir_open, "servmgr: Konnte Konfigurationsverzeichnis nicht " + "oeffnen: '%s'\n"), full_config_path); return false; } diff --git a/src/modules/servmgr/lang/Makefile.conf b/src/modules/servmgr/lang/Makefile.conf new file mode 100644 index 0000000..594ef2a --- /dev/null +++ b/src/modules/servmgr/lang/Makefile.conf @@ -0,0 +1 @@ +CC_FLAGS_APPEND="-Wno-missing-braces" diff --git a/src/modules/servmgr/lang/lang_en.c b/src/modules/servmgr/lang/lang_en.c new file mode 100644 index 0000000..11ed0b0 --- /dev/null +++ b/src/modules/servmgr/lang/lang_en.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2011 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Patrick Pokatilo. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "resstr.h" + +static int get_number(int n) +{ + return (n == 1 ? 0 : 1); +} + +static const struct tms_strings dict[] = { + &__tms_config_service_depends, + "servmgr: service '%s' depends on '%s', which is not present in the configuration!\n", + + &__tms_config_dir_open, + "servmgr: could not open configuration directory: '%s'\n", + + &__tms_main_usage, + "usage: servmgr [startup services ...]\n", + + &__tms_main_not_running, + "service '%s' is not running!\n", + + &__tms_service_not_found, + "servmgr: service not found: '%s'\n", + + &__tms_service_dependency, + "servmgr: could not resolve dependency on '%s'. Thus, '%s' can not be started.\n", + + &__tms_service_timeout, + "servmgr: timeout while waiting for service '%s'\n", + + 0, + 0, +}; + +static const struct tms_lang lang = { + .lang = "en", + .numbers = 2, + .get_number = get_number, + .strings = dict, +}; + +LANGUAGE(&lang) diff --git a/src/modules/servmgr/lang/resstr.h b/src/modules/servmgr/lang/resstr.h new file mode 100644 index 0000000..8c6d536 --- /dev/null +++ b/src/modules/servmgr/lang/resstr.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2011 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Patrick Pokatilo. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL; + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY; + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RESSTR_H +#define RESSTR_H + +extern void* __tms_config_service_depends; +extern void* __tms_config_dir_open; + +extern void* __tms_main_usage; +extern void* __tms_main_not_running; + +extern void* __tms_service_not_found; +extern void* __tms_service_dependency; +extern void* __tms_service_timeout; + +#endif diff --git a/src/modules/servmgr/main.c b/src/modules/servmgr/main.c index a432208..87bd280 100644 --- a/src/modules/servmgr/main.c +++ b/src/modules/servmgr/main.c @@ -43,6 +43,9 @@ #include "servmgr.h" +#define TMS_MODULE main +#include + bool service_running(const char* name); bool service_wait(const char* name, uint32_t timeout); @@ -80,8 +83,8 @@ static void parse_params(int argc, char* argv[]) list_push(startup_services, argv[i]); } } else { - puts("Aufruf: servmgr " - "[Startup-Services ...]"); + puts(TMS(usage, "Aufruf: servmgr " + "[Startup-Services ...]\n")); exit(-1); } } @@ -127,7 +130,7 @@ static void failed_startup_services(void) int i; for (i = 0; (service = list_get_element_at(startup_services, i)); i++) { - printf("Service '%s' laeuft nicht!\n", service); + printf(TMS(not_running, "Service '%s' läuft nicht!\n"), service); } } @@ -140,6 +143,8 @@ static void failed_startup_services(void) */ int main(int argc, char* argv[]) { + tms_init(); + // Parameter verarbeiten parse_params(argc, argv); diff --git a/src/modules/servmgr/service.c b/src/modules/servmgr/service.c index 65e9f5d..a416ddb 100644 --- a/src/modules/servmgr/service.c +++ b/src/modules/servmgr/service.c @@ -42,6 +42,9 @@ #include "servmgr.h" +#define TMS_MODULE service +#include + /** * Pid eines Services anhand seines Namens finden * @@ -107,15 +110,16 @@ bool service_start(const char* name) } if (!conf_serv) { - printf("servmgr: Service nicht gefunden: %s\n", name); + printf(TMS(not_found, "servmgr: Service nicht gefunden: '%s'\n"), name); return false; } // Abhaengigkeiten starten for (i = 0; (dep = list_get_element_at(conf_serv->deps, i)); i++) { if (!service_start(dep->name)) { - printf("servmgr: Konnte die Abhaengigkeit von %s nicht erfuellen. " - "%s kann deshalb nicht gestartet werden.\n", dep->name, name); + printf(TMS(dependency, "servmgr: Konnte die Abhängigkeit von %s " + "nicht erfüllen. '%s' kann deshalb nicht gestartet werden.\n"), + dep->name, name); return false; } } @@ -123,7 +127,8 @@ bool service_start(const char* name) if (conf_serv->start_cmd) { pid_t pid = init_execute(conf_serv->start_cmd); if ((conf_serv->conf.wait == SERVSTART) && !service_wait(name, 10000)) { - printf("servmgr: Timeout beim Warten auf den Service %s\n", name); + printf(TMS(timeout, "servmgr: Timeout beim Warten auf den " + "Service '%s'\n"), name); return false; } else if (conf_serv->conf.wait == TERMINATE) { int status; -- 1.7.0.4 From shyxormz at asxsoft.de Mon Feb 14 16:31:39 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Mon, 14 Feb 2011 16:31:39 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_tcpip=3A_Fix_f=C3=BCr_Bug_73?= =?utf-8?q?_-_tcpip_ohne_Netzwerkkarte_gibt_rot?= Message-ID: <1297697499-371-1-git-send-email-shyxormz@asxsoft.de> ! tcp vertraut jetzt nicht mehr darauf, dass auch ein device in der route vorhanden ist Signed-off-by: Patrick Pokatilo --- src/modules/tcpip/tcp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/modules/tcpip/tcp.c b/src/modules/tcpip/tcp.c index 38f9761..358100e 100644 --- a/src/modules/tcpip/tcp.c +++ b/src/modules/tcpip/tcp.c @@ -191,7 +191,7 @@ struct tcp_connection* tcp_open_connection(uint32_t ip, uint16_t port) struct routing_entry* route = get_routing_entry(ip); uint64_t timeout; - if (route == NULL) { + if ((route == NULL) || (route->device == NULL)) { return NULL; } -- 1.7.0.4 From arne.hasselbring at googlemail.com Mon Feb 14 18:14:19 2011 From: arne.hasselbring at googlemail.com (Arne Hasselbring) Date: Mon, 14 Feb 2011 18:14:19 +0100 Subject: [tyndur-devel] [PATCH] + which: Neuer lbuild Message-ID: <1297703659-2669-1-git-send-email-arne.hasselbring@googlemail.com> Signed-off-by: Arne Hasselbring --- lbuilds/which/2.20/files/compile.patch | 34 +++++++++++++++++++++ lbuilds/which/2.20/files/run.patch | 23 ++++++++++++++ lbuilds/which/2.20/which-2.20.lbuild | 50 ++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 0 deletions(-) create mode 100644 lbuilds/which/2.20/files/compile.patch create mode 100644 lbuilds/which/2.20/files/run.patch create mode 100644 lbuilds/which/2.20/which-2.20.lbuild diff --git a/lbuilds/which/2.20/files/compile.patch b/lbuilds/which/2.20/files/compile.patch new file mode 100644 index 0000000..781cbe4 --- /dev/null +++ b/lbuilds/which/2.20/files/compile.patch @@ -0,0 +1,34 @@ +Index: which-2.20/bash.c +=================================================================== +--- which-2.20.orig/bash.c ++++ which-2.20/bash.c +@@ -34,1 +34,0 @@ */ +-#define HAVE_GETGROUPS +@@ -426,23 +426,4 @@ { +- struct passwd *entry; +- +- /* Don't fetch this more than once. */ +- if (current_user.user_name == 0) +- { +- entry = getpwuid (current_user.uid); +- if (entry) +- { +- current_user.user_name = savestring (entry->pw_name); +- current_user.shell = (entry->pw_shell && entry->pw_shell[0]) +- ? savestring (entry->pw_shell) +- : savestring ("/bin/sh"); +- current_user.home_dir = savestring (entry->pw_dir); +- } +- else +- { +- current_user.user_name = "I have no name!"; +- current_user.user_name = savestring (current_user.user_name); +- current_user.shell = savestring ("/bin/sh"); +- current_user.home_dir = savestring ("/"); +- } +- endpwent (); +- } ++ current_user.user_name = "Tyndur user"; ++ current_user.user_name = savestring (current_user.user_name); ++ current_user.shell = savestring ("file:/apps/sh"); ++ current_user.home_dir = savestring ("file:/"); diff --git a/lbuilds/which/2.20/files/run.patch b/lbuilds/which/2.20/files/run.patch new file mode 100644 index 0000000..c858b38 --- /dev/null +++ b/lbuilds/which/2.20/files/run.patch @@ -0,0 +1,23 @@ +Index: which-2.20/bash.c +=================================================================== +--- which-2.20.orig/bash.c ++++ which-2.20/bash.c +@@ -359,1 +359,1 @@ string is returned in that case. */ +- if (i && string[i] == ':') ++ if (i && string[i] == ';') +@@ -362,1 +362,1 @@ +- for (start = i; string[i] && string[i] != ':'; i++) ++ for (start = i; string[i] && string[i] != ';'; i++) +Index: which-2.20/which.c +=================================================================== +--- which-2.20.orig/which.c ++++ which-2.20/which.c +@@ -174,1 +174,1 @@ { +- const char *pwd = getenv("PWD"); ++ const char *pwd = getenv("CWD"); +@@ -179,1 +179,1 @@ +- if (*cwd != '/') ++ if (*cwd != '/' && strncmp(cwd, "file:/", 6)) +@@ -203,1 +203,1 @@ +- if (*p1 != '/') ++ if (*p1 != '/' && strncmp(p1, "file:/", 6)) diff --git a/lbuilds/which/2.20/which-2.20.lbuild b/lbuilds/which/2.20/which-2.20.lbuild new file mode 100644 index 0000000..6190239 --- /dev/null +++ b/lbuilds/which/2.20/which-2.20.lbuild @@ -0,0 +1,50 @@ +include lutils +include toolchain + +DESCRIPTION="" +HOMEPAGE="http://lowlevel.brainsware.org/wiki/index.php/LOST/Pakete/Bash" +SRC_URI="http://ftp.gnu.org/gnu/which/which-2.20.tar.gz" + +LICENSE="GPL" + +RUN_DEPEND="" +BUILD_DEPEND="" + +MY_S="${S}/${P}" + +src_unpack() { + lunpack ${P}.tar.gz + cd ${MY_S} + + ln -s ${F} patches + [ -f ${F}/series ] && ln -s ${F}/series series + for i in ${F}/*.patch; do + [ -L series ] || echo `basename $i` >> series + (which quilt > /dev/null 2>&1) || (patch -p1 < $i) || die "Fehler beim Anwenden von $i" + done + (which quilt > /dev/null 2>&1) && quilt push -a || die "Fehler beim Anwenden der Patches" +} + +src_configure() { + cd ${MY_S} + + ./configure \ + CC=`tc-cc` \ + --build=`tc-build` \ + --target=`tc-host` \ + --host=`tc-host` \ + --prefix="${R}" \ + --disable-nls \ + || die "configure failed" +} + +src_compile() { + cd ${MY_S} + lmake +} + +src_install() { + cd ${MY_S} + lmake -j1 DESTDIR="${D}" install || die "make install failed" +} + -- 1.7.1 From shyxormz at asxsoft.de Mon Feb 14 22:03:37 2011 From: shyxormz at asxsoft.de (Patrick Pokatilo) Date: Mon, 14 Feb 2011 22:03:37 +0100 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_shell=3A_Fix_f=C3=BCr_Bug_39?= =?utf-8?q?_-_Speicherleck_in_ps/pstree?= Message-ID: <1297717417-10554-1-git-send-email-shyxormz@asxsoft.de> ! ps und pstree geben den Speicher für die task_info wieder frei Signed-off-by: Patrick Pokatilo --- src/modules/c/shell/cmds/ps.c | 2 ++ src/modules/c/shell/cmds/pstree.c | 1 + 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/modules/c/shell/cmds/ps.c b/src/modules/c/shell/cmds/ps.c index 2f1cc66..94e3843 100644 --- a/src/modules/c/shell/cmds/ps.c +++ b/src/modules/c/shell/cmds/ps.c @@ -105,6 +105,8 @@ void ps_display_usage(void); temp = NULL; } + mem_free(task_info, task_info->info_size); + return EXIT_SUCCESS; } diff --git a/src/modules/c/shell/cmds/pstree.c b/src/modules/c/shell/cmds/pstree.c index ec7dded..4ff50ff 100644 --- a/src/modules/c/shell/cmds/pstree.c +++ b/src/modules/c/shell/cmds/pstree.c @@ -58,6 +58,7 @@ task_info_t* task_info; task_info = enumerate_tasks(); pstree_show_children(0, 0); + mem_free(task_info, task_info->info_size); return EXIT_SUCCESS; } -- 1.7.0.4 From christian.klahn at live.de Mon Feb 14 22:20:04 2011 From: christian.klahn at live.de (Christian Klahn) Date: Mon, 14 Feb 2011 22:20:04 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=5BPATCH=5D_Alle_Zeilenumbr=FCche_k?= =?iso-8859-1?q?onvertiert?= Message-ID: -------------- nächster Teil -------------- Ein Dateianhang mit HTML-Daten wurde abgetrennt... URL: -------------- nächster Teil -------------- Ein Dateianhang mit Binärdaten wurde abgetrennt... Dateiname : 0001-Die-Zeilenumbr-che-in-den-Dateien-vereinheitlicht.patch Dateityp : text/x-patch Dateigröße : 124290 bytes Beschreibung: nicht verfügbar URL : From kevin at tyndur.org Tue Feb 15 21:36:10 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Tue, 15 Feb 2011 21:36:10 +0100 Subject: [tyndur-devel] [PATCH 1/2] kernel2: VM86-TSSe initialisieren In-Reply-To: <1297802171-20681-1-git-send-email-kevin@tyndur.org> References: <1297802171-20681-1-git-send-email-kevin@tyndur.org> Message-ID: <1297802171-20681-2-git-send-email-kevin@tyndur.org> ! kernel2: Wenn man ein TSS vor der Benutzung nullt, dann ist es seltener ungültig und verursacht damit auch kein #TS mehr. Signed-off-by: Kevin Wolf --- src/kernel2/src/arch/i386/vm86.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/kernel2/src/arch/i386/vm86.c b/src/kernel2/src/arch/i386/vm86.c index 923991a..09404d9 100644 --- a/src/kernel2/src/arch/i386/vm86.c +++ b/src/kernel2/src/arch/i386/vm86.c @@ -230,6 +230,9 @@ static int create_vm86_task(int intr, vm86_regs_t* regs, uintptr_t stack) 0x100000, KERNEL_MEM_END, MM_FLAGS_KERNEL_DATA); cpu_tss_t* gpf_tss = vm86_tss + 1; + memset(vm86_tss, 0, sizeof(*vm86_tss)); + memset(gpf_tss, 0, sizeof(*gpf_tss)); + lock(&gdt_lock); int vm86_tss_index = next_entry_index++; -- 1.6.0.2 From kevin at tyndur.org Tue Feb 15 21:36:09 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Tue, 15 Feb 2011 21:36:09 +0100 Subject: [tyndur-devel] [PATCH 0/2] VM86-Fixes Message-ID: <1297802171-20681-1-git-send-email-kevin@tyndur.org> Kevin Wolf (2): kernel2: VM86-TSSe initialisieren kernel2: Ein VM86-Speicherleck gefixt src/kernel2/src/arch/i386/vm86.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) From kevin at tyndur.org Tue Feb 15 21:36:11 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Tue, 15 Feb 2011 21:36:11 +0100 Subject: [tyndur-devel] [PATCH 2/2] kernel2: Ein VM86-Speicherleck gefixt In-Reply-To: <1297802171-20681-1-git-send-email-kevin@tyndur.org> References: <1297802171-20681-1-git-send-email-kevin@tyndur.org> Message-ID: <1297802171-20681-3-git-send-email-kevin@tyndur.org> ! kernel2: TSSe beim Verlassen des VM86 freigeben Signed-off-by: Kevin Wolf --- src/kernel2/src/arch/i386/vm86.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/kernel2/src/arch/i386/vm86.c b/src/kernel2/src/arch/i386/vm86.c index 09404d9..4edb42c 100644 --- a/src/kernel2/src/arch/i386/vm86.c +++ b/src/kernel2/src/arch/i386/vm86.c @@ -471,6 +471,8 @@ static void destroy_vm86_task(cpu_tss_t* tss) mmc_destroy(&vm86_status.mmc); + mmc_vfree(&mmc_current_context(), tss, NUM_PAGES(2 * sizeof(cpu_tss_t))); + // Wir sind fertig mit VM86 :-) pm_unblock_rpc(current_process, current_process->pid); vm86_status.in_use = 0; -- 1.6.0.2 From dickhuuhn at googlemail.com Tue Feb 15 23:11:55 2011 From: dickhuuhn at googlemail.com (David Kolossa) Date: Tue, 15 Feb 2011 23:11:55 +0100 Subject: [tyndur-devel] [PATCH] Uebersetzung fuer ftp Message-ID: <1297807915.1926.1.camel@PCTheEmperor> + Uebersetzung fuer ftp ! Boeser Typo Signed-off-by: David Kolossa --- src/modules/c/ftp/Makefile.all | 2 +- src/modules/c/ftp/command.c | 63 +++++++++++++----------- src/modules/c/ftp/ftp.c | 23 ++++++--- src/modules/c/ftp/help.c | 54 -------------------- src/modules/c/ftp/lang/lang_en.c | 100 ++++++++++++++++++++++++++++++++++++++ src/modules/c/ftp/lang/resstr.h | 44 +++++++++++++++++ src/modules/c/ftp/main.c | 40 ++++++++++++--- 7 files changed, 226 insertions(+), 100 deletions(-) delete mode 100644 src/modules/c/ftp/help.c create mode 100644 src/modules/c/ftp/lang/lang_en.c create mode 100644 src/modules/c/ftp/lang/resstr.h diff --git a/src/modules/c/ftp/Makefile.all b/src/modules/c/ftp/Makefile.all index 54bf0d0..8f2b1fa 100644 --- a/src/modules/c/ftp/Makefile.all +++ b/src/modules/c/ftp/Makefile.all @@ -2,6 +2,6 @@ shopt -s extglob source $LOST_BUILDMK_ROOT/config.sh echo "LD $1/apps/ftp" -$LOST_TOOLS_LD -oftp $LDSCRIPT *.o --start-group $2 --end-group +$LOST_TOOLS_LD -z muldefs -oftp $LDSCRIPT *.o lang/*.o --start-group $2 --end-group mv ftp $1/apps/ diff --git a/src/modules/c/ftp/command.c b/src/modules/c/ftp/command.c index 56fdde1..e275c74 100644 --- a/src/modules/c/ftp/command.c +++ b/src/modules/c/ftp/command.c @@ -1,5 +1,5 @@ /** - * Copyright (c) 2009 The tyndur Project. All rights reserved. + * Copyright (c) 2009, 2011 The tyndur Project. All rights reserved. * * This code is derived from software contributed to the tyndur Project * by Paul Lange. @@ -43,6 +43,9 @@ #include #include +#define TMS_MODULE ftp +#include + #include "ftp.h" #define BLOCK_128K 131072 @@ -59,12 +62,13 @@ void ftp_user(void) // falls keine Verbindung besteht, abbrechen if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } - asprintf(&prompt, "\033[1;37mBenutzer (%s): \033[0m", host); + asprintf(&prompt, TMS(prompt_user, "\033[1;37mBenutzer (%s): \033[0m"), + host); input = readline(prompt); free(prompt); @@ -78,7 +82,7 @@ void ftp_user(void) response(); free(input); - input = readline("\033[1;37mPasswort: \033[0m"); + input = readline(TMS(prompt_password, "\033[1;37mPasswort: \033[0m")); for (; isspace(*input); input++); for (c = input; !isspace(*c) && *c; c++); @@ -100,8 +104,8 @@ void ftp_ls(void) char buffer[BLOCK_128K]; if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -115,7 +119,7 @@ void ftp_ls(void) // das verbraucht noch viel Zeit, da tyndur lange braucht für das fclose() fclose(data_handle); response(); - puts("\033[1;37mDatenverbindung beendet\033[0m"); + puts(TMS(data_disconnect, "\033[1;37mDatenverbindung beendet\033[0m")); } @@ -135,8 +139,8 @@ void ftp_get(char* pathname) size_t count; if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -160,7 +164,8 @@ void ftp_get(char* pathname) if (strncmp("550", string, 3) == 0) { fclose(file_handle); fclose(data_handle); - puts("\033[1;37mDatenverbindung beendet\033[0m"); + puts(TMS(data_disconnect, "\033[1;37mDatenverbindung beendet" + "\033[0m")); return; } line_end = false; @@ -179,7 +184,7 @@ void ftp_get(char* pathname) fclose(file_handle); fclose(data_handle); response(); - puts("\033[1;37mDatenverbindung beendet\033[0m"); + puts(TMS(data_disconnect, "\033[1;37mDatenverbindung beendet\033[0m")); } @@ -197,8 +202,8 @@ void ftp_put(char* pathname) size_t count; if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -219,7 +224,7 @@ void ftp_put(char* pathname) fclose(file_handle); fclose(data_handle); response(); - puts("\033[1;37mDatenverbindung beendet\033[0m"); + puts(TMS(data_disconnect, "\033[1;37mDatenverbindung beendet\033[0m")); } @@ -231,8 +236,8 @@ void ftp_put(char* pathname) void ftp_mkdir(const char* pathname) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -250,8 +255,8 @@ void ftp_mkdir(const char* pathname) void ftp_rm(const char* pathname) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -269,8 +274,8 @@ void ftp_rm(const char* pathname) void ftp_rmdir(const char* pathname) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -288,8 +293,8 @@ void ftp_rmdir(const char* pathname) void ftp_cd(const char* pathname) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -305,8 +310,8 @@ void ftp_cd(const char* pathname) void ftp_cdup(void) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -322,8 +327,8 @@ void ftp_cdup(void) void ftp_pwd(void) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } @@ -339,8 +344,8 @@ void ftp_pwd(void) void ftp_sys(void) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine Serververbindung " + "vorhanden...\033[0m")); return; } diff --git a/src/modules/c/ftp/ftp.c b/src/modules/c/ftp/ftp.c index 3346e56..8988806 100644 --- a/src/modules/c/ftp/ftp.c +++ b/src/modules/c/ftp/ftp.c @@ -1,5 +1,5 @@ /** - * Copyright (c) 2009 The tyndur Project. All rights reserved. + * Copyright (c) 2009, 2011 The tyndur Project. All rights reserved. * * This code is derived from software contributed to the tyndur Project * by Paul Lange. @@ -41,6 +41,9 @@ #include #include +#define TMS_MODULE ftp +#include + #include "ftp.h" #define COMMAND_PORT 21 @@ -142,7 +145,7 @@ void ftp_connect(char* hostname) char* c; if (handle != NULL) return; - puts("\033[1;37mVerbinde...\033[0m"); + puts(TMS(connecting, "\033[1;37mVerbinde...\033[0m")); // tcpip-Pfad erzeugen asprintf(&host_path, "tcpip:/%s:%d", hostname, COMMAND_PORT); @@ -150,14 +153,17 @@ void ftp_connect(char* hostname) free(host_path); if (!handle) { - puts("\033[1;37mFehler: Host nicht erreichbar!\033[0m"); + puts(TMS(host_not_reachable, "\033[1;37mFehler: Host nicht " + "erreichbar!\033[0m")); handle = NULL; return; } - printf("\033[1;37mVerbunden mit %s, warte auf Antwort...\033[0m\n", host); + printf(TMS(connected, "\033[1;37mVerbunden mit %s, warte auf " + "Antwort...\033[0m\n"), host); response(); - asprintf(&prompt, "\033[1;37mBenutzer (%s): \033[0m", host); + asprintf(&prompt, TMS(prompt_user, "\033[1;37mBenutzer (%s): \033[0m"), + host); input = readline(prompt); free(prompt); @@ -170,7 +176,7 @@ void ftp_connect(char* hostname) fflush(handle); response(); - input = readline("\033[1;37mPasswort: \033[0m"); + input = readline(TMS(prompt_password, "\033[1;37mPasswort: \033[0m")); for (; isspace(*input); input++); for (c = input; !isspace(*c) && *c; c++); @@ -194,7 +200,7 @@ void ftp_disconnect(void) request("QUIT"); fclose(handle); handle = NULL; - puts("\033[1;37mVerbindung getrennt...\033[0m"); + puts(TMS(disconnected, "\033[1;37mVerbindung getrennt...\033[0m")); } @@ -213,7 +219,8 @@ FILE* ftp_data_connect(void) int i = 0; FILE* data_handle = NULL; - puts("\033[1;37mDatenverbindung wird geöffnet...\033[0m"); + puts(TMS(data_connect, "\033[1;37mDatenverbindung wird geöffnet..." + "\033[0m")); fprintf(handle, "%s\r\n", "PASV"); fflush(handle); diff --git a/src/modules/c/ftp/help.c b/src/modules/c/ftp/help.c deleted file mode 100644 index b7dbf59..0000000 --- a/src/modules/c/ftp/help.c +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2009 The tyndur Project. All rights reserved. - * - * This code is derived from software contributed to the tyndur Project - * by Paul Lange. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the tyndur Project - * and its contributors. - * 4. Neither the name of the tyndur Project nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -const char* help = - "FTP-Client Befehlsliste:\n\n" - "ascii - ascii Mode einschalten\n" - "binary - binary Mode einschalten\n" - "bye - schließt die Verbindung zum Server und beendet den FTP-Client\n" - "cd - [Pfad] wechseln des Verzeichnisses auf dem Server\n" - "cdup - wechselt zum Stammverzeichniss auf dem Server\n" - "clear - löscht den Inhalt des Terminals\n" - "close - schließt die Verbindung zum Server\n" - "get - [Pfad+Dateiname] holt eine Datei vom Server\n" - "help - zeigt diese Hilfe an\n" - "mkdir - [Pfad+Ordnername] erstellt einen Ordner auf dem Server\n" - "open - [ftp.name.net] öffnet eine Verbindung zu einem Server\n" - "put - [Pfad+Dateiname] speichert eine Datei auf dem Server\n" - "pwd - zeigt das akutell geoeffnete Verzeichniss auf dem Server an\n" - "rm - [Pfad+Dateiname] löscht die Datei auf dem Server\n" - "rmdir - [Pfad+Verzeichnisname] löscht ein Verzeichnis auf dem Server\n" - "system - zeigt den Namen des Betriebssystems vom Server an\n" - "user - einloggen mit Benutzername und Passwort\n"; diff --git a/src/modules/c/ftp/lang/lang_en.c b/src/modules/c/ftp/lang/lang_en.c new file mode 100644 index 0000000..87845f3 --- /dev/null +++ b/src/modules/c/ftp/lang/lang_en.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2011 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Kevin Wolf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "resstr.h" + +static int get_number(int n) +{ + return (n == 1 ? 0 : 1); +} + +static const struct tms_strings dict[] = { + {&__tms_ftp_host_not_reachable, + "\033[1;37mError: Host not reachable\033[0m"}, + + {&__tms_ftp_connecting, + "\033[1;37mConnecting...\033[0m"}, + + {&__tms_ftp_connected, + "\033[1;37mConnected with %s, waiting for reply...\033[0m\n"}, + + {&__tms_ftp_prompt_user, + "\033[1;37mUser (%s): \033[0m"}, + + {&__tms_ftp_prompt_password, + "\033[1;37mPassword: \033[0m"}, + + {&__tms_ftp_disconnected, + "\033[1;37mDisconnected...\033[0m"}, + + {&__tms_ftp_data_connect, + "\033[1;37mOpening data connection...\033[0m"}, + + {&__tms_ftp_data_disconnect, + "\033[1;37mData connection terminated\033[0m"}, + + {&__tms_ftp_no_connection, + "\033[1;37mError: Not connected...\033[0m"}, + + {&__tms_ftp_usage, + "FTP-Client command list:\n\n" + "ascii - switch to ascii mode\n" + "binary - switch to binary mode\n" + "bye - close any open server connection and quit\n" + "cd - change active remote directory\n" + "cdup - change to remote root directory\n" + "clear - clear the terminal\n" + "close - close server connection\n" + "get - [path+file name] get a file from the server\n" + "help - show this help text\n" + "mkdir - [path+dir name] create a directory on the server\n" + "open - [ftp.name.net] open a connection to a server\n" + "put - [path+file name] save a file on the server\n" + "pwd - show current working directory\n" + "rm - [path+file name] delete a file on the server\n" + "rmdir - [path+dir name] delete a directory on the server\n" + "system - show the name of the remote operating system\n" + "user - log in with user and password\n"}, + + {&__tms_ftp_type_help, + "\033[1;37mType `help` to get a list of available commands!\033[0m"}, + + {0, + 0}, +}; + +static const struct tms_lang lang = { + .lang = "en", + .numbers = 2, + .get_number = get_number, + .strings = dict, +}; + +LANGUAGE(&lang) + diff --git a/src/modules/c/ftp/lang/resstr.h b/src/modules/c/ftp/lang/resstr.h new file mode 100644 index 0000000..e245427 --- /dev/null +++ b/src/modules/c/ftp/lang/resstr.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Kevin Wolf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL; + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY; + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RESSTR_H +#define RESSTR_H + +extern void* __tms_ftp_host_not_reachable; +extern void* __tms_ftp_connecting; +extern void* __tms_ftp_connected; +extern void* __tms_ftp_prompt_user; +extern void* __tms_ftp_prompt_password; +extern void* __tms_ftp_disconnected; +extern void* __tms_ftp_data_connect; +extern void* __tms_ftp_data_disconnect; +extern void* __tms_ftp_no_connection; +extern void* __tms_ftp_usage; +extern void* __tms_ftp_type_help; + +#endif diff --git a/src/modules/c/ftp/main.c b/src/modules/c/ftp/main.c index cd71d92..98f06bc 100644 --- a/src/modules/c/ftp/main.c +++ b/src/modules/c/ftp/main.c @@ -1,5 +1,5 @@ /** - * Copyright (c) 2009 The tyndur Project. All rights reserved. + * Copyright (c) 2009, 2011 The tyndur Project. All rights reserved. * * This code is derived from software contributed to the tyndur Project * by Paul Lange. @@ -41,6 +41,9 @@ #include #include +#define TMS_MODULE ftp +#include + #include "command.h" #include "ftp.h" @@ -49,6 +52,8 @@ FILE* handle; int main(int argc, char* argv[]) { + tms_init(); + bool prgm_end = false; char* input; @@ -100,7 +105,26 @@ int main(int argc, char* argv[]) ftp_disconnect(); prgm_end = true; } else if (!strncmp(input, "help", 4)) { - printf(help); + printf(TMS(usage, + "FTP-Client Befehlsliste:\n\n" + "ascii - ascii Mode einschalten\n" + "binary - binary Mode einschalten\n" + "bye - schließt die Verbindung zum Server und beendet den FTP-Client\n" + "cd - [Pfad] wechseln des Verzeichnisses auf dem Server\n" + "cdup - wechselt zum Stammverzeichniss auf dem Server\n" + "clear - löscht den Inhalt des Terminals\n" + "close - schließt die Verbindung zum Server\n" + "get - [Pfad+Dateiname] holt eine Datei vom Server\n" + "help - zeigt diese Hilfe an\n" + "mkdir - [Pfad+Ordnername] erstellt einen Ordner auf dem Server\n" + "open - [ftp.name.net] öffnet eine Verbindung zu einem Server\n" + "put - [Pfad+Dateiname] speichert eine Datei auf dem Server\n" + "pwd - zeigt das akutell geoeffnete Verzeichniss auf dem Server an\n" + "rm - [Pfad+Dateiname] löscht die Datei auf dem Server\n" + "rmdir - [Pfad+Verzeichnisname] löscht ein Verzeichnis auf dem Server\n" + "system - zeigt den Namen des Betriebssystems vom Server an\n" + "user - einloggen mit Benutzername und Passwort\n") + ); } else if (!strncmp(input, "close", 5)) { ftp_disconnect(); } else if (!strncmp(input, "user", 4)) { @@ -118,21 +142,21 @@ int main(int argc, char* argv[]) } else if (!strncmp(input, "ascii", 5)) { // falls keine Verbindung besteht, abbrechen if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine " + "Serververbindung vorhanden...\033[0m")); continue; } request("TYPE A"); } else if (!strncmp(input, "binary", 6)) { if (handle == NULL) { - puts("\033[1;37mFehler: keine Serververbindung vorhanden..." - "\033[0m"); + puts(TMS(no_connection, "\033[1;37mFehler: keine " + "Serververbindung vorhanden...\033[0m")); continue; } request("TYPE I"); } else { - puts("\033[1;37mGeben sie help ein um eine Liste aller Befehle " - "zu erhalten!\033[0m"); + puts(TMS(type_help, "\033[1;37mGeben Sie help ein um eine " + "Liste aller Befehle zu erhalten!\033[0m")); } free(input); -- 1.7.0.4 -------------- nächster Teil -------------- Ein Dateianhang mit Binärdaten wurde abgetrennt... Dateiname : nicht verfügbar Dateityp : application/pgp-signature Dateigröße : 198 bytes Beschreibung: Dies ist ein digital signierter Nachrichtenteil URL : From max at tyndur.org Wed Feb 16 20:45:20 2011 From: max at tyndur.org (Max Reitz) Date: Wed, 16 Feb 2011 20:45:20 +0100 Subject: [tyndur-devel] [PATCH 1/2] kernel2: VM86-TSSe initialisieren In-Reply-To: <1297802171-20681-2-git-send-email-kevin@tyndur.org> References: <1297802171-20681-1-git-send-email-kevin@tyndur.org> <1297802171-20681-2-git-send-email-kevin@tyndur.org> Message-ID: <4D5C2950.2030409@tyndur.org> Am 15.02.2011 21:36, schrieb Kevin Wolf: > ! kernel2: Wenn man ein TSS vor der Benutzung nullt, dann ist es > seltener ungültig und verursacht damit auch kein #TS mehr. > > Signed-off-by: Kevin Wolf > Acked-by: Max Reitz From max at tyndur.org Wed Feb 16 20:46:20 2011 From: max at tyndur.org (Max Reitz) Date: Wed, 16 Feb 2011 20:46:20 +0100 Subject: [tyndur-devel] [PATCH 2/2] kernel2: Ein VM86-Speicherleck gefixt In-Reply-To: <1297802171-20681-3-git-send-email-kevin@tyndur.org> References: <1297802171-20681-1-git-send-email-kevin@tyndur.org> <1297802171-20681-3-git-send-email-kevin@tyndur.org> Message-ID: <4D5C298C.90904@tyndur.org> Am 15.02.2011 21:36, schrieb Kevin Wolf: > ! kernel2: TSSe beim Verlassen des VM86 freigeben > > Signed-off-by: Kevin Wolf > Acked-by: Max Reitz From arthur_verberkt at msn.com Fri Feb 18 11:21:52 2011 From: arthur_verberkt at msn.com (Arthur Verberkt) Date: Fri, 18 Feb 2011 11:21:52 +0100 Subject: [tyndur-devel] How to install tyndur-gcc without lpt tool. Message-ID: Hi guys, I?m playing with and testing the tyndur system. Have once installed all packages with and test it with succes. Now in another situation i want install applications manual, before i create the hd image, (without lpt) so i unzip as example the nano package in the root/apps directory, create a new hd image and test it and nano works fine. Now i try to do the same with gcc and libc but this is another story and need a little support for the right directory structure and path settings. Have try the following but it fails : 1. unzip libc in system dir 2. unzip gcc in apps dir 3. create new hd image and start tyndur 4. set PATH file:/apps/;file:/apps/gcc/4.2.2/bin 5. gcc ?o test test.c Get a unknown error 5 and gcc failed to build. I know that doing it this way is not confirm the tyndur rules but i?m wondering if it?s possible and how configure gcc to do it this way. Best Regards, Arthur Verberkt, The Netherlands -------------- nächster Teil -------------- Ein Dateianhang mit HTML-Daten wurde abgetrennt... URL: From kevin at tyndur.org Mon Feb 21 21:37:26 2011 From: kevin at tyndur.org (Kevin Wolf) Date: Mon, 21 Feb 2011 21:37:26 +0100 Subject: [tyndur-devel] How to install tyndur-gcc without lpt tool. In-Reply-To: References: Message-ID: <20110221203725.GA11387@silvanus> Hi Arthur, On Fri, Feb 18, 2011 at 11:21:52AM +0100, Arthur Verberkt wrote: > I?m playing with and testing the tyndur system. > Have once installed all packages with and test it with succes. > > Now in another situation i want install applications manual, before i create the hd image, (without lpt) > so i unzip as example the nano package in the root/apps directory, create a new hd image and test it and nano works fine. > > Now i try to do the same with gcc and libc but this is another story and need a little support for the right directory structure and path settings. > > Have try the following but it fails : > 1. unzip libc in system dir > 2. unzip gcc in apps dir > 3. create new hd image and start tyndur > 4. set PATH file:/apps/;file:/apps/gcc/4.2.2/bin > 5. gcc ?o test test.c > > Get a unknown error 5 and gcc failed to build. > > I know that doing it this way is not confirm the tyndur rules but i?m wondering if it?s possible and how > configure gcc to do it this way. It's definitely not how it's meant to work, yes. Anyway, error 5 is ENOENT, so it's searching some file which you haven't put in the right place. My approach would be a bit different: 1. Create a build/root-local directory if it doesn't exist yet 2. Unpack tarballs into build/root-local 3. Create directory build/root-local/system/lpt-bin and link or copy all binaries there (basically what postinstall-bin would do when called from lpt) 4. Copy libgcc.a to buid/root-local/system/lib 5. Create new disk image, start tyndur, gcc -o test test.c If it still doesn't work, try using some verbose flags in order to get the missing file name. Hope this helps, Kevin From DoBi-tyndur at gmx.net Sun Feb 27 13:43:43 2011 From: DoBi-tyndur at gmx.net (DoBi-tyndur at gmx.net) Date: Sun, 27 Feb 2011 13:43:43 +0100 Subject: [tyndur-devel] =?iso-8859-1?q?=28kein_Betreff=29?= Message-ID: <20110227124343.31240@gmx.net> -- Schon gehört? GMX hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://www.gmx.net/de/go/toolbar -------------- nächster Teil -------------- Ein Dateianhang mit Binärdaten wurde abgetrennt... Dateiname : 0001-Neues-Programm-Hangman.patch Dateityp : application/octet-stream Dateigröße : 6450 bytes Beschreibung: nicht verfügbar URL : From DoBi-tyndur at gmx.net Mon Feb 28 21:52:22 2011 From: DoBi-tyndur at gmx.net (DoBi-tyndur at gmx.net) Date: Mon, 28 Feb 2011 21:52:22 +0100 Subject: [tyndur-devel] Hangman ueberarbeitet Message-ID: <20110228205222.301070@gmx.net> -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone -------------- nächster Teil -------------- Ein Dateianhang mit Binärdaten wurde abgetrennt... Dateiname : 0001-Hangman-ueberarbeitet.patch Dateityp : application/octet-stream Dateigröße : 8244 bytes Beschreibung: nicht verfügbar URL :