THIS TRANSCRIPT IS AUTOMATICALLY GENERATED BY COMPUTER VOICE RECOGNITION. It is good enough to be worth posting, but not perfectly accurate. Do not cite it or take it too seriously; if people do, then I will take it offline. i welcome to my scheduled stream for monday labor day i am in this stream going to work on finalizing the leapfrog phi cf kits that i've been that i've actually been kind of putting off for awhile because i've had other things come up that i've had to deal with and then i'm probably also going to do some work on the deeper than the fat thirty two code for the the usb host module that i've been working on that is another thing that is kind of behind schedule although we'll talk about some of the stuff that wedding went into that now i'm trying inasmuch as today is likely to be a slow day with it being the holiday and so forth and so on i am trying some different settings and a different set up here with the the streaming arrangements in particular i've got another laptop computer involved here and its running devil one linux which is not a distribution i'm very familiar with but i i've been wanting to try dev one so why install that and i can't say i'm terribly thrilled with it in particular i had a hell of a time trying to get the touchpad to work and that's never been an issue for me with laptops and other linux so apparently by default it has the tap to click feature turned off and its not at all obvious how to turn that on and it still doesn't work perfectly but it works well enough that i'm able to run the the twitch stream what do they call it stream commander or whatever it is ah and that way i can have my other laptop here free for use with the the development tools for microcontrollers which i am i'm going to have an easier time debugging i think if i don't also have to do stream control from that laptop i've commented on this before but the stream control with twitch is a hugely expensive in terms of cpu power and i don't understand why because you'd think they would understand the importance making that by wait if you're going to also be running gaming and whatever else on your computer that you stream from anyway are in other streams mostly and a little bit off stream i have put together bags of goodies that go into way leapfrog kit and i also have an eye on tax some of these on on stream a little while back too i have sets of boards now the new boards from india is there a darker blue and i debated you know i don't have exactly identical numbers of the older lighter blue ones so i was thinking well that's ok i'll use up my older ones first and then i'll just putting the darker blue these are almost perfectly as and as as needed but then that would mean shipping some kits with boards that don't match you know like you get to board one here that slider blue board three that's darker perfectly blue and i thought that that would probably not be a good thing i think people would if their kid builders they'd probably like to have the boards all match so i'm thinking that i'll save the last few boards that won't match and use them in my hand assembled modules possibly especially for the accustomed panel assembled modules were i don't think it'll show as much and you know if people are getting accustomed panel anyway they expect it to look a little funky and that should be fine so that's the state of those boards and i have here the i call it a happy user letter for complicated historical reasons but then this is the sheet of paper that goes into the kit and newly updated version with a qr code which will actually take you to the a page on my website that has the assembly instructions although heaven help you if you're trying to read the pdf on and off on a smartphone but you know people like to see qr codes now you've heard me complain at length about the used in bags that piling up i went through and i found all the ones that i thought were the right size to contain a kit and i've got five of them here which i figure i'll reuse for these now you know why i want to be environmental and so on and use a re reused bag tags wherever possible and i hope that my customers will appreciate that however these bags are not quite as nice as the ones that i bought that were brand new they often have little holes punched in them i think that's to prevent like pressure build up or something and they're out there a little wrinkly and they're thinner plastic but i decided i'm going to try using them for this batch of kits and see how people feel if i get complaints about the the reused bags then i may have to only use only use virgin fresh bags but i'd like to reuse bags wherever possible so and especially given that i have just a few that are really the right size for kit the ones that are the right size i think i definitely want to try to reuse hello to a beaut and haas one three twelve underscore i i don't know how big a turnout we're going to get today it being labor day when i was when i was in denmark the may first holiday came around and some people asked me do you have may first in canada and you know i was tempted to say well no we just go directly from last of april to may second or what of course what they meant was is may first celebrated as a holiday in canada indeed is not we have labor day in early september and i think the reason is because of the associations of may first specifically with communism and the american influence here we can't have anything that looks like a show recognition of communism being in any way acceptable we even have a thanks to the conservative government we have a monument to the victims of communism in ottawa so celebrating the the value of of work and have people who do work that has to be done on some other day and labor day holiday at least in this era is not very political at all like on may first in denmark people want to go listen to speeches and here its just another day that is the marker for when in the school year will start don't get me started on the fact that we're starting another year of school in the middle of a a steadily growing wave of pandemic illness and we still are not authorizing children to receive the vaccine so we're sending sending them to to gather in groups indoors without any protection this whole adventure has really opened my eyes to i i always thought oh but think of the children was like the the thought ending line for any any issue in north america but evidently sending children to school has to take priority over over their safety and so it looks like these are these banks as i thought were the right size and the paper does fit nicely still looks kind of wrinkly on there though i hope that's going to be okay i have really mixed feelings about especially given how much i charge people for these products about selling a product its in a bag that looks like this but what can you do right the the environmental concern of disposing of these bags is real and its not going to be that many because i don't have many bags that i'm in a position to reuse that are this size can really be used this way so i'm still going to be using a brand new bags most of the time what we do what we can this one does not fit perfectly yeah i think i'm going to make it work anyway though i'm going to cut a little chunk off the in this paper like two millimeters will be enough so that i feel it will fit this is probably closer to one millimeter but that may still be enough think i need another millimeter or two maybe i'll take it off this side too i hand some adventures where i upgraded my slackware installation on my desktop machine and from that day on i my printer didn't want to print with correct margins and after a lot of work i eventually determined that what was going on was that it was attempting to rescale everything to fit on an a for page now in a four page he used in places where they have the first of may is its narrower and taller than the letter-sized standard page that i use and so the result was that it was actually shifting vertically on the the real page that i was printing on i in screwing up the margins that way and i went through now this is this is ocular the katie e i pdf reader and customer support for katie he is a joke especially when it comes to printing so there was not really much hope there i ended up actually going through the source code and figuring out what was going on to some extent i never found out why he thought that my printer was configured for a four paper but i was able to find that it was running the lpr program passing it every time unconditionally no matter what options were actually selected it was passing it a command line argument that told it okay rescale this page to a four and so what i ended up doing was i actually replaced the lpr program with a perl script that i wrote myself and and it detects that option and removes it before pep calling the real lpr program so that so that works you know i and now every time i i print something i have a little thrill of hey its actually printing correctly i'm just up here looking for panels gonna have to go outside the range of my lie share to what get them let's see i need here's three and here's two more yeah so its kind of a thrill now everytime i print something to see that it does really print the size it should be alright so panels check this off on the checklist and i need your rep power cables do i have those already know i our cables have two kinds well actually three there's the sixteen pin kind and these there's only one of those right that there's not like a left-hand and right-hand version but for the ten pin kind which are used by this module there's the left-hand and right-hand version i because you will basically always have the stripe down and the two ends are not the same so the ten pin end fits into the module on the sixteen pin end fits into the bus board so i call this one a left hand cable because when you plug it into the module the cable goes off to the left and i call this one the right-hand cable because when you plug it into the module author never went into the module it goes off to the right for the leapfrog in particular it doesn't matter which one you use they they'll both fit on the board but i there are some other modules where it has to be one or the other so i have to keeper a stock of both and i think i'm going to use right hand cables for this batch of leap frogs because i seem to have a few more of those or i did before i just just grabbed five of them okay so check off power cable sticker sheets tarot cards i've got the happy user damn it i something i really want for all mia installations of the the devon system they're just popped up at screensaver or after much too short of a delay something i really want is to just turn off the screensaver except still have it available for manual inculcation like sometimes i want to locklear or freeze the screen and i want to have a button for doing that but i don't ever really want it to happen just because of a delay and i have yet to figure out how to do that because on a linux system there are so many different places screensavers can be configured it doesn't seem possible to turn them all off and and if you do still want to run the screensaver team and if you want to be able to invoke it manually then it frequently does not have a do not pop up option now i need five tarot cards here we can be surprised and a few minutes when i turn those over and see what they are and also five five stickers every time you buy secrets from these people sticker mule they send you like a bar mail to a little coaster and as i've been as as its been summer i've been drinking iced drinks of different kinds more often and using those coasters and they get soggy and eventually they get moldy so i had to throw them out i now completely out of coasters and i think i may actually have to buy or make some new coasters because i still have plenty of these stickers i know not going to be due to put it another order with the mule for awhile okay so i have everything on my list here and i can start putting it all together oh i do these in a fairly specific order to try and to make the nicest possible package so the panel goes pretty much in front and then i build up a little stack with the boards and the terror occurred i guess i should look at this each of wands and the terror card and the stick are part of the purpose they serve is they going between these boards so that the boards won't rub against each other because if they do rub they may scratch and its pretty unlikely that they would scratch themselves badly enough to actually do any electrical damage but again because of this as i do diy kit the customers are going to be seeing those sports up close and so i want them to look as nice as possible alright next time guess i'll put in these smaller bags i have reusable or reused plastic bags for the small ones as well which i have not yet decided whether i'll be attempting to put them in here in in kid so on i guess i probably will but they raise the same issues really that the the used ones are a thinner thinner plastic film than the ones i would buy if i were buying them so they don't look quite as nice and they tend to be a bit scruffy fit this in here guess i should have put the cable in the first really go and the two two cable ties its going alright how does this work to da one leapfrog kit and now i just have four more of them so this whole stack of boards and panel goes in the bottom there its the heaviest thing and that's where it would shift too a hundred different motion of things going in there you know these go through a fair bit of a fair bit of abuse and shipping and storage and whatever else so i tried to make a solid package here that long to won't be a problem as it shifts around yeah i know what i don't think i even looked at that tarot card i kind of would like to see it yeah or maybe not no i don't think i bought her but we'll look at the next couple let's see the empress and the emperor and the hero from okay bunch of big names there okay i was the screensaver came up again i've been streaming thirty minutes and basically not touching the computer so i think it must be on a fifteen minute delay so we'll feel indulge me for a minute here i'm going to try to find whether i can turn that off or something maybe settings display i know that's just for setting like clock speed and so settings desktop as a background thing and menus and icons no screensaver as i've mentioned there's like fifteen different places say fourteen forty okay see there's an arbitrary limit here i cannot set it to fourteen forty minutes the maximum it will accept is seven hundred twenty why there's no good reason there are four for there to be any limit on that at all and and there's no option for just not having a screen say an automatic pop up with a screensaver i mean i could remove the screen server software from my system entirely but that wouldn't that wouldn't be what i want i want to have it i just don't want it to happen automatically i mean maybe this is maybe i'm reading too much into it but it sure seems like there's been a trend toward less and less user control nothing is allowed to be manual anymore it all has to be automatic this and now i'm really dating myself by saying this but this was my gripe with katie e for that there used to be a button for manually hiding the the taskbar and then there wasn't any more and they said oh well you can configure the automatic hiding no i don't want automatic hiding i want to have a button for manually hiding it all but you can invoke the automatic hiding by moving to the side to know i don't want to know a symptomatic of the general issue with katie e of not listening to users but it was i guess the printer thing was worse but the taskbar auto hiding thing its pretty bad too just zero comprehension of the idea that someone might want to be able to actually control it it shouldn't be always an automatic thing i mean really something that is underrated is the importance of users being able to have a mental model of a how a computerized system works and we see that with google i mean i don't know how old you are and if you remember but there was a time when google search results didn't suck there was a time when that was actually what google was good at and what they were famous for and how they became a major corporation and that time was a long time ago because the the search engine results have just gotten smarter and smarter its no longer just a glorifying keyword search its its now some survey i think that attempts to guess what question you are asking and there is no way to control you can't there's no way to know what it will conclude from what you enter and so its impossible to build a mental model any more like the original google was basically a keyword search i think it would search for maximum number of keywords you entered with the possibility to override it with necessary and forbidden conditions you could say this word must be done by adding a plus or this word must not be in by adding a minus and then it would rank according to the the value of a page in the i can vector of the principal eigenvalue of the adjacent see matrix so perfectly straightforward right i mean that concept actually is a much simpler thing than it may sound you don't really need to know what an eigenvector is its just that the idea that some sort of energy flows along the links and things that have a lot of incoming links from a lotta places are probably valuable webpages worth looking at so i mean google once worked that way and now there's no way of knowing how it works and its secret its easy to say oh well they had to change their algorithm because because of spam but they've done a whole lot of things that they didn't need to do because of spam and given that they're in the business of selling advertising you know any anything that they say about the scourge of spam has to be taken with a grain of salt and the result is that now you can't find what you wanted in google anymore especially not if what you want is something that doesn't make them money and there's no replacement there's no other new search engine that actually works that is available because everybody he's in it to make money and if they think they want to compete with google then they're going to try to do the same things that they see google doing just try to somehow do better at making money we never should have allowed commercial use of the internet i mean look at twitter look at twitch case closed basically alright so that is five leapfrog kits i still have some concerns about these bags that look kind of wrinkly yeah well that's the way it goes just see if i when i sell them if i get any complaints i so i'm going to move these to this table over here i don't really want to dig through the the bin that they're stored in which is ana high shelf back there and then we're going to have the interesting adventure of me trying to hook up my other laptop here with screen capture and we'll see how that works part of the issue with me not wanting to do software to debug on stream is that i end up having to run you know multiple layers of ah the the the microchip development tools and until i had the separate laptop for it also twitch is a stream controller and screen capture now i don't actually have to do the real the real serious and coding company the laptop that is on a desktop machine or out of out of view here but it needs to at least be able to screen capture itself and ship that over the network to the bigger computer and screen capturing is pretty expensive and the microchip tools are very happy so its rather a tight fit let's see though let's see how this works and i can't like do this development on the big desktop machine partly because i don't want to trust those microchip tools to run on the big desktop machine they have a boatload of telemetry and so on and also because i need to be at my electronics workbench with the power cable and power supply and so on in order to run the in order to run the usb host that i'm going to be working on so plug this in boot it up and did i put that this thing i'm going to need a network cable as well and i probably should hook that up through the through the usb hub just change views here okay call me paranoid but i don't really want to have my keyboard on screen while typing passwords okay so what if i got here can i get away without having a web browser probably better keep the web browser and now i have to find the command for streaming ah streaming this laptops whew its just done sh alright okay so i'm gonna i don't know if my big computer will oh actually accept this but let's try can i just run the fm pig command yeah alright so the the laptop is now sending its screen two to the desktop and let's see if desktop can pick it up ooh that looks good for me you can watch ff mpeg produces so many error messages i you know there's a strong element of black art in getting this to work alright so with that working i now i've got here various get goodies and gizmos let me give you the camera again can play a little show until i okay so here's the the laptop and its got the el cheapo usb hub with the usb ethernet through which its streaming i mean there are so many variables here i didn't want to also be trying to do this wirelessly also on that hub is the microchip pic kit for which is four up controlling and debugging the microcontroller chips that i'm working on and then i also have this i call it the my first easy bake usb protocol analyzer because its its the cheapest usb protocol analyzer that money can buy and and i got it used so just plug that in here because i want to run the usb connection between my my device and the in this case usb usb flash drives through that so that i can capture the traffic as they talk to each other alright so i mean that may not even really be necessary i mean not its not the low level stuff i'm worried about right now but it'll probably help to have it okay so now i've also got this thing which is the the actual machine that i'm working on this is an early prototype of the year msk or fourteen gracious host oh and basically its just a thin wrapper around this microchip twenty eight pin microcontroller which you know its its a sixteen bit computer with however much ram eight k of ram and sixty four k of programmable rom programmable through this thing and its got a whole bunch of built-in peripherals so its a nice chip to program for unfortunately i ordered a mauser said they had forty in stock and i ordered all forty and they delivered thirty two and microchip the manufacturer says that they will have more stock the last several times i've checked its always been one year minus one day from the current date so on september second they said they'd have it september first of next year and september third they said they'd have it september second of next year and so on so i don't know if i will ever be able to buy more of these like controller chips and if i can't then i'd better sell all the ones that i have because otherwise i won't even make make back the development costs as this has taken a long time to develop and a heck of a lot of programming on the firmware and the firmware is not even finished yet although its getting pretty close basically the the missing piece is i needed to be able to read files off a usb key and use them to reflash its own firmware so that someone will be able to reflash the firmware in the field without using one of these machines and i have all the parts for that except i think there are some incorrect calculations in the fat thirty two file system code that cause it to not read the correct sector when its following the chain of links through the fat thirty two now i mean that's you know a fairly specific and esa tierra kind of thing but it does need to to actually be right or else i can't ship this song so what i'm looking at doing today and i don't know how well this will work because it was kind of a last minute thing i've been working on other things i shelved this for awhile and then they all while i have to have some stream content so what i'm going to try to do is find the find the mistake so let's go back to that screen capture now we're looking at the the screen of the laptop you can see my pretty desktop picture there i and okay i guess i'm gonna need to boot up the power supply that's off screen there let's let's open mp lab just update from subversion most of these recent changes have been on the documentation i haven't touched the code in a little while and it'll start that that's gonna take a while to start though not quite as bad when i'm not also running the the fucking stream manager so well that's working i have to get the voltage right on my power supply my power supply is a cheap chinese one and it has single single turn pots for controlling the voltage and its also a little bit temperature sensitive i think so i guess i better plug this one in first incidentally if you saw me unpack the box of the box of circuit boards from india they sent me this key chain which is a little ls usb light so if i plug that into the usb port on here it lights up whoop de do not sure how useful it is to have a light that you know is just plugs into a usb port them has to be plugged directly into the port but that's what that is alright so i can plug that in and i guess i this will be next i can't remember which end is which on this thing yeah and i the the my first easy bake protocol analyzer its got to this uplink port that goes to the actual computer that will be analyzing stuff but then it also is designed to splicing between host and device solve this little cable goes to my my machine which is the host and then i will be plugging devices into her here and the analyzer in theory doesn't interfere with the the traffic on the bus it just records it something i could view who said what on the bus and learn whether there's something wrong with my drivers now you can get a usb analyzer that is just a just a piece of software that runs on your pc or whatever that's fine if you're debugging connections between that pc and the device but it doesn't work very well when when you are actually debugging the host okay so now this thing is actually still not fully booted up it says its background scanning of projects but its basically started and you know watching a minute or two would also pop up a stupid message about wanting to be upgraded i no i have a bunch of usb usb memory sticks that have been loaded with different things and i'm going to i guess swap camera again you know this is this one has a fat thirty two file system on it with a file that my firmware ought to read but i don't think it really will so i'm going to plug it in here and then we can step through the code and see what happens i have got my own makefile system and its only an uneasy fit with the mp lab mp lab as the microchip yeah here we go pack updates available there it seems to be no way to turn that off short of going to extremes like firewalling the software to prevent it talking to the net at all i the mp lab x id he really wants to generate your makefiles for you and that's not a good plan because my makefiles is a whole lot of other things so i had to go to some lengths to create sort of a stub project file that would allow it to run my makefile and not mess with it and in the near future i'm going to have to write up how to do that to go in the documentation of my module which i'm not looking forward to but it does work so that's fine i you know having having run that yeah i should have said build for debugging i think i did now i'm going to program the device so this is just sending that to firmware that i just compiled through the year the link to the the chip alright its programmed so now i should be able to watch the debugger and run it in a second yeah ok so if i run that see what happens now it says its running but its not blinking its a little light switch is a bit of a surprise the no lights here so let's ah interrupted and see where we're at okay so it is hanging up waiting for a bite to be read that's interesting it wasn't something i expected so let's see i think its maybe a bug that i've already seen somewhere once before right send the right command okay so the thing is that with its talking from the the cpu to the to the sram chip using an interface called s p i and the thing is with spr you have to read and write simultaneously so what you end up doing is you queue up the bike you want to write and then you ask to read a bite and then that will have the effect of writing your bite as well and there's a buffer so you can queue up several bytes in advance and then and then do the corresponding reads and if you actually did want bright usually the read will be ignored it'll be garbage data so you just do the reads to make it iterate through its buffer so i did have an issue at one point where i was reading one less bite than i was writing so that would mean that the buffer would slowly fill i guess its also possible that this is not an error and its just that because it was reading badly from the fat thirty two file system its got more data than it thinks it should have and so its just taking a long time i mean its having to do all kinds of skenazy and usb transactions in the background here so actually that may be more likely so let's reset this and get me another terminal we're going to actually use the the beagle i'm starting up the the analysis software for them my first easy bake usb analyzer here and now this thing is a little flaky so it may just give me a bunch of errors but i've told her to start capturing so now i go back to mp lab reset and run yeah its just giving a bunch of errors the thing is this thing is it doesn't seem to have a clear idea of whether it wants to be talking to them in usb high speed or low speed or or full speed to usb has four speeds it has high i know it has low speed full speed high speed and superspeed now my hardware can only actually do low speed and full speed but it appears that the the analyzer doesn't have it sometimes defaults to the wrong one so let's clear that out i'll try unplugging this and unplugging that and re plugging both actually i should start the capture before i plug it in cause that seems to have it make it work okay devices can close communication error that's because i unplugged it so i'm going to have to restart this software which fortunately runs relatively fast its not like m p lab witches a real pain if you have to stop and restart it okay now i start this plucking this okay now with a little luck at me it may capture at the correct speed right alright no that didn't help so stop start oh there we go there are some real transactions going by and you can see its a whole lot of them so i think this is just symptomatic of the trouble with the the fount driver because there are some large files on the usb key and i think what's happening is that because it miscalculated where i like it it goes through the the directory structure finds the the proper cluster number and then it has to find i'm just thinking out loud here and then it has to find the right sector for that or the right entry in the in the fat and then it follows the linked list through and i think what's happening is its somehow getting into the wrong file so its ending up in the middle of some other file that happens to be huge and so its reading through all of that file and dumping it into the sram chip which won't hurt the sram chip but it its just the wrong data so i think maybe what i need to do his prepare better i a better usb key because this one has all kinds of weird crap on it it was a a key that was used as like the extra storage during a windows upgrade and its actually a very weird fan file system on there it has a whole bunch of sort of forbidden data so i think the thing to do is create a smaller usb file system and then i can step through that and see if if this code i currently have ever works and if it does at some point work then i won't be able to you know sorta to would diff its interesting that this is still running i guess just the fact of having an i mean if its miscalculating how to follow the links that may well have gotten into a loop anyway so let's pause this and stop this clearer we can leave them running i think i alright i'm going to need to another oh another usb key and i've got several here i'm not sure which ones i can safely override so i'm going to have to take a look at what's on them just plugging another usb key into the hub here okay all that's on that one is this bmp directory which is from using it for ourself on the scope scope shots so that's one i can safely put things on and its probably a fairly well behaved file system so let's let's do that firmware data from ram if i remember correctly its one of the files that that this code is supposed to be looking for yeah from where this may not show well on the stream but i've got a text constant here which is the filename that is searching for witches from where dot frm so i just copied that to another usb key and we'll see if if the gracious hosts can recognize it solid that's been copied and unmanaged don't unplug that pluck this one this one in i basically trust the code up to this point so let's let's break at the point where it actually recognizes the the filing that is here if i run up to this point yeah really i should have had the capture running and i should have had the camera on so let's reset that and turn on the capture and i'll just push us back on the camera briefly now if i run into that point you should see the lights blink on the host as it goes through usb enumeration and so on alright now onto the laptop so at this point in the code it has recognized the file name i wanted and it just sends a reset command to the sram to make sure that that is in a known state now get the i know that reading the first cluster works i've had that succeed before so w zero its to cluster and i ordered the clusters zero and then we check is this the fat thirty two i believe it will be what its trying to do is read the file and write it into this sram chip so its going to try to get the first block of the file working register true here contains values zero nine eight two which is a pointer to a structure that describes a cluster number in that contains the data that we that we wrote its a byte zero or i guess sector zero within cluster zero four fifty and its more serious after that for higher bites and then when it calls we'll get kava it may be that i took too long to do that so its up the machine has gone into an error stage here both let's try resetting that and running jew after that point if i tell it to run here actually let's look at the capture as well it just says singer its not critical right now alright we ran up to here yeah get kava has succeeded and w for now contains a pointer to the buffer that it just filled just address twelve forty six and if we look here the first bites of that r m s k space on all four space from where copyrights okay so it has correctly loaded the first the first block of the file because its those those bites are the ones that occur at the start of that file then it goes through sets up a write command then its going to send all the bytes of that block to the sram and then there's this loop test and the spr transaction etc so all that looks good up to this point increment camera is a a function that then points that that address at the next block and that is inside theories where it actually hits the the file allocation table and finds the next cluster number and so on so i guess gonna have to run up to that point the first layer of this is just that its goes to the next block within the same cluster arab again part of the fun with usb is that if you don't send a command or don't do anything for a while the device will decide that the host is dead and just reset itself so you you have to keep things moving through through the usb bus let's try this again with a reset going to set a breakpoint here the thing is i wanted to be able to catch it when its actually going to the next cluster in a year i saw a file so iterating through the the sectors in the first cluster is not very very useful because i know that part works okay so now i've run through to the end here we're getting the correct cluster there's a fair bit of multi precision arithmetic that has to be done here because of this is found thirty two at least potentially and the its only a sixteen bit microcontroller so we check is this fell twelve don't think so sep sixteen or thirty two so we're gonna take the cluster member the design registers w four in w five that's all for fifty may recall what just happened there oh yeah its because if you hover i hate when that happens things should not pop up just because you hover the mouse but that was what happened okay so anyway double that multiply by two shift left and rotate left and then test is this really fat sixteen or thirty two its thirty two so then we have to multiply by two again we're taking the we're trying to find a byte offset inside the the fat so fat entry if its three two bits its four bytes so at this point w three w two its become one one forty which is twice for fifty in hexadecimal or four times four fifty i guess fat block size is two hundred texts that's five twelve bytes and then let's skip over that deficient instruction one of the funny things about this microcontrollers that if you want to do division there's a division instruction but you have to run it eighteen times that's how they implement the somewhat complicated binary long division algorithm so w five to ducking for contains zero zero two latex which is the block index of the the corresponding sector of the file application table epithet is going to fail yup alright i'm gonna have to do this with the break points again so i set a breakpoint after that call it failed and i'm gonna just run full speed until just after it because the issue is that if i interrupted with the with the debugger then it won't come back when i restart so at this point it has read the sector of the the sector that contains the relevant part of the file allocation table so its going to have to look in that table find the entry and it currently has a pointer to it and then it gets the cluster number from there you know its going to check for whether that question number is a special value sent indicating for instance the end of the table there's the number that was in there the first cluster of this file is cluster number four fifty and after going through all that work neural and reading the the fount it now thinks the next clusters for fifty one which sounds very plausible the ok the if i do this its probably if i go to the next one its probably going to crash again yeah but that means that it is successfully going through and read the the second cluster of the file no let's see if we can figure out whether it actually read the file correctly the second question correctly i can do that by ah putting on a fancy break points here i will make it break not on the first time around but on the second or actually its going to have to be even fancier i want to break here only after it has hit the other break point this breakpoint point here is one i didn't set up this session but its if there's a memory alignment error it should break sears line five ninety something i want to set up a complex break point and two new sequence i don't know why it insists on having a name for the sequence move to fool okay so i think what this means is that if it hits line seven or three which is inside that process for loading the next job cluster if it does if it goes to the next cluster and then after attacker has read the first block it'll break i may have gotten those in the wrong order but we can deal with that okay yeah i did get those in the wrong order so let's try and changing that move up alright so at this point it should have gotten the first block the first block the first sector let's say of the second cluster and w four has the value two for eighty and that should be a pointer to where the block is stored in memory so if i go there the i can read out the bytes six four two eight e f six b now we'll look at the young we'll look at that from our data from file this is the the assembler generated listing and it contains hex dump six four two eight e f maybe i really want to look at image target list too six four two eight iaf six four two eight e f six b four eight six for trade and six b four c e f six p four h e one o two o all iwan o'toole so that's definitely where we're at see if we can find the address this is a zero to six zero and somewhere below that next addresses thirteen something it looks like its about halfway between the two so this is probably address one thousand we can check that more carefully in a minute ah and address one thousand to be four kilobytes right sixteen times geophysics yeah its plausible that that too the file system has a cluster size of four kilobytes so i think at this point it is correctly going onto the next cluster and i think the problem with my other one is that when the cluster number is much larger so it doesn't fit in sixteen bits there's something weird about the carry between the low and the high words so that is yeah i see if i remember the syntax for the odi command not quite right i wanted it to be single bytes tc next there we go oh not quite come on i want i want to see hex for single bytes there we go i alright here we go here is address one thousand and its a six four to a gf six b four eight that's the same thing we're seeing here six forward to wait e f sixty four eight so i think what we've established here is that it is correctly reading the second cluster of the file and it did not do that on the other on the other usb key by way of verification let's try swapping the keys and running again now here we are at this point where it has read what it thinks is the second cluster of the file and register for four points at twelve forty six two and its totally different data its fifty thirty nine b six which might not necessarily be an issue if the cluster size is different but its not found in this dump at all so with the one file system that's fairly well behaved and has the file near the start of the disk its correctly reading the second cluster of the file and with the other file system that's weirdly organized and has the file pretty deep into the disk because its a large large usb key its not correctly reading the file now i'm not sure that i'm going to be able to get much further ah with that today i just trying to leading all and i think i may have just crashed mp lab but i am glad that i was able to get back into touching that at least a little because its something that i've been sort of overdue on i think it being a holiday monday and that i don't really want to try to keep poking at that right now that i'm going to probably call the stream at this point unless there are any critical questions that people want me to answer and i will say i hope you enjoy and thanks for watching and have a nice day yeah yeah the the the the