**This is an old revision of the document!** ----
June 22: One of the things I had neglected to do was automating testing. So, I decided to do that: * In src/config/defaults/pcbios.h: changed #define CONSOLE_PCBIOS to #define CONSOLE_SERIAL * make * qemu -tftp . -cdrom bin/gpxe.iso -bootp /tests//arith_test.gpxe -serial stdio > result * Make sure the file generated gives the expected output. This can then be used to compare the output of the test script after changes have been made After this, I started implementing the if-else branch. Since this includes defining new commands, I had to find out how it was done: struct command if_command __command = { .name = "if", .exec = if_exec, }; Also, added this in src/core/config.c #ifdef IF_CMD REQUIRE_OBJECT ( if_cmd ); #endif and this in src/config/general.h #define IF_CMD This tells the linker to link in the code that implements the if command, present in if_cmd.c. The conditional linking is a pretty cool idea. June 23: Implemented [[http://git.etherboot.org/?p=people/lynusvaz/gpxe.git;a=commit;h=4e0cdde5de459076f0a1470e1e9705aab5b4c9a3|if-else-fi]], using the stack idea. Realised, however, that I needed to also record the size of the stack for branches that are not taken. This is required for nested ifs in non-executed branches; without it branches with a true condition inside a false branch will be taken: if 0 <statements> if 1 <statements> fi else <statements> fi Also fixed this problem in quoting that I hadn't considered: [[http://git.etherboot.org/?p=people/lynusvaz/gpxe.git;a=commit;h=1110b2eab3ddec5cce4d4e3c491175da927d9f42|empty quotes]] '' and "" were not recognised, by adding a parameter to signify the parse function's success. June 24: One of the suggestions I got from Stefan was to use a stack to store the arguments, instead of a linked list. I couldn't really see the connection between a stack and the argv until he mentioned that he was thinking of an array implementation. So, that would remove the need to allocate a new char* array. Now, since I will be using a fair number of stacks: two for the if branches, this new one and probably another for loops, I decided to see if a generic stack implementation would help. So, today's commits: * [[http://git.etherboot.org/?p=people/lynusvaz/gpxe.git;a=commit;h=29cc67894c7468f6d61cd7893569141cd909d91b|argv with generic stack]] * [[http://git.etherboot.org/?p=people/lynusvaz/gpxe.git;a=commit;h=46d979297a96bc2723fd273476570d47bf4da292|If-else-fi with generic stack]]