Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 00fe6bb in mainline


Ignore:
Timestamp:
2009-06-27T09:41:55Z (12 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master
Children:
6408be3
Parents:
1fbe064b
Message:

Automatically try to mount FAT from disk0 on /data upon boot. Save Tetris score there. Automatically create disk image in sample config files, if it does not already exist. This tentatively reaches the Milanstone (t.m.).

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • contrib/conf/mips32-gx.sh

    r1fbe064b r00fe6bb  
    11#!/bin/sh
    22
    3 gxemul $@ -E testmips -C R4000 -X image.boot
     3DISK_IMG=hdisk.img
     4
     5# Create a disk image if it does not exist
     6if [ ! -f "$DISK_IMG" ]; then
     7        tools/mkfat.py uspace/dist/data "$DISK_IMG"
     8fi
     9
     10gxemul $@ -E testmips -C R4000 -X image.boot -d d0:"$DISK_IMG"
  • uspace/app/init/init.c

    r1fbe064b r00fe6bb  
    151151}
    152152
     153void mount_data(void)
     154{
     155        int rc;
     156
     157        printf("Trying to mount disk0 on /data... ");
     158        fflush(stdout);
     159
     160        rc = mount("fat", "/data", "disk0", "wtcache", 0);
     161        if (rc == EOK)
     162                printf("OK\n");
     163        else
     164                printf("Failed\n");
     165}
     166
    153167int main(int argc, char *argv[])
    154168{
     
    172186        spawn("/srv/fhc");
    173187        spawn("/srv/obio");
    174        
     188        spawn("/srv/ata_bd");
     189        spawn("/srv/gxe_bd");
     190
     191        usleep(250000);
     192        mount_data();   
     193
    175194        getvc("vc0", "/app/bdsh");
    176195        getvc("vc1", "/app/bdsh");
  • uspace/app/tetris/scores.c

    r1fbe064b r00fe6bb  
    203203        int rc;
    204204
    205         f = fopen("/tetris.sco", "rb");
     205        f = fopen("/data/tetris.sco", "rb");
    206206        if (f == NULL)
    207207                return ENOENT;
     
    222222        int rc;
    223223
    224         f = fopen("/tetris.sco", "wb");
     224        f = fopen("/data/tetris.sco", "wb");
    225225        cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f);
    226226        rc = fclose(f);
Note: See TracChangeset for help on using the changeset viewer.