From 2d90a80e22c7127e4b95f8624d8c08ac9668e1f8 Mon Sep 17 00:00:00 2001 From: sambas Date: Wed, 29 Sep 2010 16:29:38 +0000 Subject: [PATCH] Flight/PiOS: this patch makes dosfs work with both MBR and VBR formats. Backup your SD files in case this messes something!! Testing needed. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1798 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/PiOS/STM32F10x/Libraries/dosfs/dosfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flight/PiOS/STM32F10x/Libraries/dosfs/dosfs.c b/flight/PiOS/STM32F10x/Libraries/dosfs/dosfs.c index 1696bc5a2..8a75b95d0 100644 --- a/flight/PiOS/STM32F10x/Libraries/dosfs/dosfs.c +++ b/flight/PiOS/STM32F10x/Libraries/dosfs/dosfs.c @@ -40,6 +40,12 @@ uint32_t DFS_GetPtnStart(uint8_t unit, uint8_t *scratchsector, uint8_t pnum, uin return DFS_ERRMISC; } + // check if jump to boot, VBR + if(mbr->bootcode[0]==0xEB || mbr->bootcode[0]==0xE9){ + // MBR is actually VBR + return 0; + } + result = (uint32_t) mbr->ptable[pnum].start_0 | (((uint32_t) mbr->ptable[pnum].start_1) << 8) | (((uint32_t) mbr->ptable[pnum].start_2) << 16) |