Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/milkymist
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3a7e212
Choose a base ref
...
head repository: m-labs/milkymist
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 327bdc7
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 21, 2011

  1. flterm: make kernel image optional

    This way flterm can be used as a 'normal' terminal emulator.
    mwalle authored and Sebastien Bourdeauducq committed Nov 21, 2011
    Copy the full SHA
    eda99f1 View commit details
  2. flterm: bump version number and fix print_usage output

    Sebastien Bourdeauducq committed Nov 21, 2011
    Copy the full SHA
    327bdc7 View commit details
Showing with 17 additions and 15 deletions.
  1. +17 −15 tools/flterm.c
32 changes: 17 additions & 15 deletions tools/flterm.c
Original file line number Diff line number Diff line change
@@ -507,18 +507,20 @@ static void do_terminal(char *serial_port,
/* write to terminal */
write(0, &c, 1);

if(c == sfl_magic_req[recognized]) {
recognized++;
if(recognized == SFL_MAGIC_LEN) {
/* We've got the magic string ! */
recognized = 0;
answer_magic(serialfd,
kernel_image, kernel_address,
cmdline, cmdline_address,
initrd_image, initrd_address);
if(kernel_image != NULL) {
if(c == sfl_magic_req[recognized]) {
recognized++;
if(recognized == SFL_MAGIC_LEN) {
/* We've got the magic string ! */
recognized = 0;
answer_magic(serialfd,
kernel_image, kernel_address,
cmdline, cmdline_address,
initrd_image, initrd_address);
}
} else {
if(c == sfl_magic_req[0]) recognized = 1; else recognized = 0;
}
} else {
if(c == sfl_magic_req[0]) recognized = 1; else recognized = 0;
}
}
}
@@ -607,7 +609,7 @@ static const struct option options[] = {

static void print_usage()
{
fprintf(stderr, "Serial boot program for Milkymist SoC - v. 2.1\n");
fprintf(stderr, "Serial boot program for Milkymist SoC - v. 2.2\n");
fprintf(stderr, "Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq\n");
fprintf(stderr, "Copyright (C) 2011 Michael Walle\n");
fprintf(stderr, "Copyright (C) 2004 MontaVista Software, Inc\n\n");
@@ -618,11 +620,11 @@ static void print_usage()

fprintf(stderr, "Usage: flterm --port <port>\n");
fprintf(stderr, " [--double-rate] [--gdb-passthrough] [--debug]\n");
fprintf(stderr, " --kernel <kernel_image> [--kernel-adr <address>]\n");
fprintf(stderr, " [--kernel <kernel_image> [--kernel-adr <address>]]\n");
fprintf(stderr, " [--cmdline <cmdline> [--cmdline-adr <address>]]\n");
fprintf(stderr, " [--initrd <initrd_image> [--initrd-adr <address>]]\n");
fprintf(stderr, " [--log <log_file>]\n\n");
printf("Default load addresses:\n");
fprintf(stderr, "Default load addresses:\n");
fprintf(stderr, " kernel: 0x%08x\n", DEFAULT_KERNELADR);
fprintf(stderr, " cmdline: 0x%08x\n", DEFAULT_CMDLINEADR);
fprintf(stderr, " initrd: 0x%08x\n", DEFAULT_INITRDADR);
@@ -705,7 +707,7 @@ int main(int argc, char *argv[])
}
}

if((serial_port == NULL) || (kernel_image == NULL)) {
if(serial_port == NULL) {
print_usage();
return 1;
}