Hey guys, Shaber1000 here, what we're going to do is I'm going to show you how we put our cell phones onto a tripod, okay, in case anybody wants to know that. Of course, you can buy special tripods for a cell phone and you can find them cheap online and whatnot, but pretty much what they have on it is one of these. And this is just a selfie stick, I think, where do we buy this on? The selfie stick? Yeah. I bought a dollar tree. Yeah, I think, yeah, we bought a dollar tree, it was like a buck, just a cheap selfie stick, alright, and just, and what you're going to need is you're going to need one of these, a buck, and a tripod. This is not the tripod we normally use, I have an old tripod I bought for ten bucks at like a little yard cell type thing that's down the road here where I always tell you guys I'm buying my tools and stuff. We also bought this tripod at a yard cell, pretty cheap, what, like ten bucks or something.  Now on these newer ones, these are handy. You got a little latch right here, see that little latch? Put that latch over, like that, and that pops right off, okay? Now, what we're going to do, and these things, they just unscrew, see that? They will just unscrew right off of there. And it just so happens that this will fit this, I believe it's a, I believe that's a quarter inch, I'm not positive, I think it's a quarter inch, but anyway, you just take this right here, and screw that on, see on the bottom of this, there's a little, you know one way or the other, it's either got a little screw type or this one here, it's pretty good tripod, but I got it cheap, you can get these things cheap too, anywhere online, you can get them cheap.  Now, you want to take this, see if I can do this one handed, and just put it on there, just like you would on your selfie stick, all right? I got a case on here, so I have to be careful with mine, so it doesn't like flop out on it, so if you got a case, just be careful, okay, and it's just like that, make sure it's on there good, good and tight, it's like that, okay, now yes, my screen is very dirty, but I use it at work when I am messaging monkey, all right, and then this is just the same way as when you took it off, so you're going to take this, all right, just like this, and you're going to flip your little deal out, and put, but notice that, I can't see, yeah, just like that, now they're all pretty much the same, then you let your thing over and make sure it's flipped in, and there you go, and now you have it on a tripod, just like that, and that is how, okay, and that's how we set up, it's like that, you got your tripod, nice and handy, and again, so you're doing a video, okay, well you don't want to carry the tripod around, just flip your little handle out, and there you go, like I said, we have an order when I had bought for $10, and it's not removable because it's older, but so, and I love the removable because like I said, if we're filming or whatever, we got to take it off the tripod we can, just real quickly, you take it off, you know, same way as the camera, it just comes right off, so we use that tripod, I have it set up for her, because she uses her phone a lot to make videos and stuff, so that way she, all she's got to do is clip her phone in, and she's, she's good to go, so, excuse me folks, but I wanted to share that with you, now you can buy this set up online, you know, $15, $20, whatever, but I mean, I've, I've literally got like $10 in this thing, or whatever, so there you go guys, so just wanted to share it with you, just kind of like a life hack, you know, type thing that you can do, roll this one up here, and save a little money, you know, just, all you guys, if you're YouTubers, you may just have this stuff laying around, you know, my light just went in, so, I'm gonna charge everything up, but anyway guys, wanted to share it with you, and thanks for watching, and have a very merry Christmas, we will, we will be doing a live feed on New Year's Eve, so I don't know if you'll see this tonight, or tomorrow, which tomorrow is New Year's Eve, but either way, we're gonna do a live feed on New Year's Eve, and we're gonna do a live feed from Disney World on Christmas Day, and we will have some footage from Ripley's, believe it or not, on the 26th, which is the day after Christmas, so, and plus we'll have some videos after that of our little adventure from, from those places, and from the resort we're gonna stay at, so that's our Christmas present to each other, so anyway, merry Christmas, and happy New Year you guys, thanks for watching, Shae Bear for president, remember, the myth, the man, the legend, Shae Bear, gone for now, bye bye guys, take care now.


Come on. All right. Welcome to operating systems. Let's see if I need more volume All right. Oh, that works. Well, come on All right, so welcome back. So this is operating systems It is really hot in this room and it's kind of disgusting. So Yeah, great. All right off to a great start so Let's just dive into it and ask why we're even here. So why do you have to take this course? Why is it a useful course? Well at the very core of it Understanding operating systems will make you a better programmer Because you will actually understand what is going on with your computer and how to use it more effectively So there's only two types of software You'll be writing if you're writing software, which is probably all of you at some point in your life No matter if it's Javascript. No matter if it's Python. No matter if it's whatever You either write software that interacts with the operating system or it is the operating system Those are your only two choices in life. That's it. So you're so Knowing this course if you're using anything that uses the operating system, that's pretty much everything Otherwise you're going to be writing an operating system and then taking an operating systems course It's probably a good idea if you want to write an operating system So I'm John Ailsen your instructor I will save you the Pain of trying to pronounce and spell my last name and I will give you some simple tricks So that in red exit out terrible looks awful kind of a mess elf that's simple right Christmas is going to come up by the end of the semester and We'll be able to enjoy Christmas at the end. So hey elves will be in season there. That's easy to spell I hope only three letters The next one is sin elf sin Perfectly valid pronunciation my last name go with that makes it easy so if You mash them together you get elf sin and then if you need to spell my last name Stick a yo after the E. That's it Then hey you spelled my last name without with just remembering three simple little things that aren't that disaster of spelling So that's an easy way to remember it in case you actually have to use it for whatever reason Why would you need it? Well all of the public course material will be on my website So it's elf sin calm But spelled properly because elf sin calm costs too much money and hey It's my last name anyways, and there's not that many of me So all the course Lecturer pds the links to the lab website Links to the YouTube everything Will be public so you don't have to log into anything if you just want to look at some course material for some reason on the bus or whatever so easily accessible don't have to log in and Anything private will be on corkis. So right now corkis is a bunch of links. Eventually. You're only gonna have your grades on there And that's pretty much it So how the course will be structured you will do the labs on git lab if you use github before Then it's quite similar to that if you haven't used github before you will eventually in your career so git lab is a good introduction to that and That's how all your labs will be done There'll be no zipping files and dropping them here or whatever you just Submit your code to the server. That's it. You don't have to do anything special You don't have to write submit you don't have to do anything You just do normal software engineering things which if you don't know you will learn and That's it. No fuss. No must. No weird other additional systems You might see that people are also using the discord chat. So there's no piazza. No nothing I found discord a lot better and less annoying and it's a lot more interactive. So Use the discord. There's a class discord last Semester when I tried it a hundred percent of the students signed up for it So all of you should sign up for it like 41 percent of you have already done this before I started last last lecture So it's probably hopefully even higher now. So that's great. And then the Lectures will be streamed on YouTube and the recordings will be there. So don't have to worry about missing anything So do you want to sign into the discord? It's elfson.com slash discord and it's also the link to that's on the corkis and Through doing that it will also it'll ask your u2 or id whatever that's hooked up to the central off system and if you use that link it will also set up your git lab account for free so you don't have to do that and Also, join you to the discord server and all that fun stuff. So that's great And as you can see in the lectures, there's a space for that for chat So if you want to ask some questions there, you can if I miss it And don't see it then you can just hey flag me down class and tell me that hey There's a question there that I need to answer but I'll try and monitor it as best I can With that said lecture attendance is still important since it is much much faster for me to get feedback For you and sometimes for you to provide feedback to me Because sometimes you can do it passively if I look around and see a bunch of what the WTF faces then I know that I probably screwed up and I'll probably screw up in this lecture because the first one had some problems So hey, you can ask me questions if anything is unclear and hopefully we can resolve it in the lecture. It's just much faster We'll also have some live coding and we'll be able to create some happy accidents And I'll hopefully be able to explain some of the things you tell me to do Because that's always fun, especially if you tell me to do something that's outright insane Tell me to do it. I'll do it. We'll see if we can break my system if you can break my system You get something I Guess I probably can't give you grades, but hey, I'll give you something And if there's anything I can do to make attending lectures better Let me know first would be a call to them to turn on the AC because This room is awful So let's hope that is a call. So let's get the boring stuff out of the way and the evaluation for this course So you'll have we have 12 weeks for the course You will have six labs and they'll be due every two weeks and you might be looking at the list That's on the slides right now and say hey John what the hell there's lab zero. That's clearly seven labs not six. Why are you trying to sneak in a lab? well, I split Lab one into two parts because most of it is set up and getting familiar with the system so lab zero is all set up that you don't need any prior knowledge for and And that's it. So it's just to get you set up and then you at the end of it You do a one-line source code change prove you can use the server That's it for code changes one line and spoiler alert. It's not a complicated line It is your name and then you answer five questions on crowd mark and then which are mostly just feedback things and then that's it and Unlike in other operating system courses where I found it was always kind of weird at the end of the course You've never installed an operating system or know how to do that or have practice doing that Well lab zero guess what you are installing your own operating system to a virtual machine And it will be yours to break or use or whatever happens to happen with it But you will install an operating system from scratch. So later on in your career You'll be using virtual machines whether you like it or not. That's just how things are And hey, if some family member breaks their computer and can't afford windows Hey, you can at least install linux for them. So that'll be a great skill to have Um See what else? All right. So yeah, there'll also be a midterm exam The way this is placed is it is after reading week because we get a fall reading week So it's after reading week because that makes sense And don't worry that reading week does not eat into your lab time So calendar wise you'll have three weeks for one of the labs But again, they're supposed to be every two weeks. So you can use reading week to study for the exam That's kind of the idea for it or you know Not be engineers and try and have a life on reading week. That would be good So hopefully one of those is and then we'll have a final lots of fun All right academic honesty, so you can study together discuss concepts and discord Post unrelated code to labs and discord or at least general code is fine Most of this course is a lot of reading code being able to explain what the hell it's doing because some of it will be very surprising to you Um Yeah, as long as it's not directly your lab code go ahead post it. That's okay.  Don't do any of that Technically against academic honesty.  I have to do a lot of paperwork It's the whole thing. You don't want to do that. Trust me Your employers also don't want to see your course code on github They want to see you doing projects and trust me at the end of this course You have lots of projects you can do you can take something you want to do and just Apply the concepts of this course and make it better Lots of fun things you can do with this course and again Cheating not going to be tolerated.  It doesn't matter most of this course is reading code and being able to explain what the hell is going on So just writing code is not that big of a deal Uh, if you just kind of pound it together and it kind of works and you can't explain it Well, that's not going to help you for exams and not going to help you For anything else, right? You don't want to be the person that needs to read stack overflow over and over again You want to be the person that provides the explanation for stack overflow, right? so The recommended books just complement the lectures you don't need them But if you need an additional resource you can have them. So it's offering system three easy pieces It's free. It's you can download the pdfs. I think it also has a web version So you can go ahead and use that just to complement the lectures It this course doesn't follow that exactly but it follows more or less along the same lines and just kind of Ignore some of the more boring stuff and tries to get explain some of the things in more detail This course will be in c. So if you don't know c, uh, you should know c. You should definitely know c We will Say what you should know Hey, there we go Here's skills you should practice again if you need number one c programming and debugging again All kernels are pretty much written in c all low level software is pretty much written in c Eventually something is going to pass through c at one point or another Guess what javascript will use c Pretty much directly. I think it uses c plus plus and some implementations But at some point you're going to end up with c.  It's actually pretty small and fairly concise And yeah, you should know debugging some gdb would be okay printf debugging Uh, you might run into some errors with that But we'll kind of explain what printf actually does in this course. So you'll be able to you know use it more effectively Being able to convert between hex binary and decimal is a good skill to have Because some of the things we'll be doing in this course have some low level details Especially when we get into some memory things You will definitely find that as an asset if you can just quickly convert between them or at least have some references So when we get to that part I'll show you some tricks to kind of remember some good reference points And then you can kind of figure it out from there Little endian and big endian. So hopefully you know what those term means from your computer organization class And most importantly When we get into how memory actually works it will be difficult So understanding how you think memory works is good Even though we will completely destroy all the notions you have of that Just know that memory More or less Is byte addressable like every memory address corresponds to one byte and A memory address is basically we can use it as a pointer and that's pretty much it and then past that We will make it much much much much more complicated So again, please provide any feedback. This course Is challenging. I've tried to rework it a bit that we spend more time on the challenging parts and get some more practice With it and you actually get to play with some things that are more closer to what's really going on Um, it's not really feasible to have you create your own operating system in just a semester But hopefully you'll get enough of a flavor of it and we'll be reading parts of one where you'll actually get a pretty good Idea where you could do it if you wanted to So during these things you can ask questions, right? Remember that all Programs again, even if they're written in python javascript, whatever they're going to interact with the os We're going to find ways to figuring out how they interact with the os and being able to explain that so We can ask anything about any applications you've pretty much ever written and hopefully by the end of this course You'll be able to explain it Because I can guarantee you most of you Um If you tried to explain hello world in terms of operating systems, some of you probably actually It's expected that none of you actually know how to do it and none of you actually knows how hello world works so We'll dispel that in the next lecture, but at the core of it. This is The main job of an operating system is to manage resources And that's about it At the core of it an operating system should stay out of the way and you should not know it's there as much as possible So, you know A bunch of you that have used windows before have probably sworn at windows because you realize windows Is doing something when your application doesn't work anymore. Ideally you never want to see windows.  All you did was write like c programs And they were applications. They ran on top of an operating system It could have been windows mac os linux, whatever it ran on top of some operating system and It use that it request resources. So even if you try and run a program that's requesting resources You're requesting time on a cpu to run So no matter what your program if you're running it is going to request some type of resources Other resources that might request while memory That's the thing might request some disk space, you know access to files Things like that, but all of that at the end of the day is going to be managed by the operating system So the operating system is going to manage the resources and the operating system is what talks to hardware So in 243 your computer organization class you learn some Some things about how the hardware actually works Well, we'll see the other part of that that's in between the application and the hardware where the real magic happens So you know some details. So we're going to not discuss some low level details about how some specific hardware works We're going to be generally how pretty much every operating system works So there is three core operating system concepts So the first is virtualization and the idea behind that is You only have one of a particular resource But you're going to share it between multiple things by mimicking it and Trying to create an illusion that each of those things has its own complete independent version of it so for instance You are creating a virtual machine and installing an operating system And it is called a virtual machine because you're installing an operating system directly on it That operating system thinks it has complete control of that machine Even though physically I have one laptop right here and I only have one physical machine But I'm going to have two operating systems running on it I'll have macOS running on it and for the purpose of this course I'll also have linux running on it. So it's virtualizing my machine It's creating two independent copies of it that Each operating system thinks it has full control over But realistically we'll get into some caveats where you know one has a bit more control than the other But for the most part they both have complete control over their own virtual machine The next one is concurrency So your days of having a single program that starts execution at main and Starts executing and follows if branches and stuff Well, that is over. Your life is going to get infinitely more complicated. Don't worry. I see some worried faces already I'll be here to help you through it, but it will kind of be it'll start off Kind of like a disaster, but we'll get through it so A way to think of this is like hey If I gave you a deck of cards and told you to sort it That would be pretty easy, right? You could probably sort a deck of cards But if I told you hey You have 52 people now. I'll give each of them a single card and I want you to sort All 52 of you sort that deck of cards 52 times faster than that one single person One that's probably not going to work and two if one of you tried to explain how you would do that without killing each other You would probably spend a while trying to explain that One solution could just be hey pick the person at the front throw all the cards at them and then make them Sort it and then hey, that's probably sorter than or that's probably slower than one person So That's probably not a good solution But you kind of get the idea why it would probably be hard The next is persistence, which is going to be pretty much at the very end of the course Once you survive the first two-thirds of the course Uh persistence will not be a big deal and you you won't care that much But the first part of the course virtualization concurrency We'll get through it. It will be difficult, but you will actually know how things work, which will be hopeful hopefully good All right, so here's a quote. I was introduced to in my fourth year um, so i'm introducing it to you in your third year because this is Insanely true All problems in computer science can be solved with another level of indirection So instead of solving the problem You make a simpler problem to solve and then you solve that problem and then you map one to the other and you're all good so We're going to think about How programs even execute now. So our first abstraction in this course is called a process So Whenever you wrote hello world or anything like that Whenever you compiled that program you got an executable at the end of that, right? Well that executable we're going to call a program and that executable is actually nothing that special We're going to rip it apart and see how truly not special it is but it's just a file and all that file contains is a bunch of It telling the offering system what to do and then aside from that there's your instructions Which is basically like your assembly instructions from you know computer organization And any data that's required to run and that's it And then what a process is is when you actually run that program. So when I try to Run that program it creates a process that process executes that program So why did I say hey? What's the difference between a process and a program? Well the process is an execution of that program. It's at a certain point And we can run multiple processes at the same time In fact, that's like one of your main goals as an offering system is to run a whole bunch of different processes Most of you probably have more than one thing running on your computer like You probably have a web browser open that probably has lots of tabs You probably have you know Discord on you probably have whatever else you have lots of things running And they're all running as a process and your offering system gets to manage all of those So the basic requirements from it. So We already know that hey virtualization is a thing and if we're executing a program Well, we know physically on our cpu. There's only one set of registers And if multiple processes can run at the same time Well, if they could all overwrite each other's registers, you would probably be in a nothing would ever work No program would ever work. It would as soon as it's tried to switch to another one that monkey with the registers It would never work So the first thing that would be in a process would probably be something like virtual registers And all that means is each process would have its own independent set of registers So that one process can't interfere with another So if two processes have different sets of virtual registers, they're independent So other things a process would have because it is running Well, it would have a stack And it would have a heap right which are both located in memory Okay So here's my first question to you knowing that's a thing How would I be able to run two different programs at the same time in terms of memory? Like how would I manage? How should the operating system manage physical memory if I have two different processes each using memory? So for example, say I'm running hello world in one process And then in another process, it's some program that just counts up one every second so If I run both of these at the same time, they're both going to be processes Hopefully they have virtual registers. So they won't interfere with each other But they'll be using physical memory too so How would you think, you know, they interact with your operating system in terms of memory like Anyone with any guess Yep Yeah, so that seems reasonable. So if my operating system is managing physical memory Well, the hello world program, I'll just give Some memory and then if I'm the operating system and I control all physical memory It's not really a reach to think that hey, it probably knows what else is free So the next process that comes in I'll allocate it some space for its stack and they'll be In different regions of memory and they'll be, you know, they won't interfere with each other So that seems reasonable. Anyone argue with that? Okay, reasonable, great So the stacks for each process, they need to be in physical memory Operating system keeps track of physical memory just gives them different physical addresses Still no one thinking of any issues. Oh, yep Okay. Yeah, first problem is well, if they're in physical memory and if it's one than the other The other could use more space than it got allocated and then start screwing with the other person's stack That would probably not be good. Yep If you run out of memory that could also not be good. Yeah Yeah, so one argument is they might use different amounts of memory Specifically for the stack Funnily enough Each process gets the same amount of stack space no matter what it is pretty much I think the default number now is every process gets two megabytes of memory for the stack And if you use more than that, that's that stack overflow message so Yeah, running into each other's stack might be a problem But you know if we believe the operating system is all magical It may be able to monitor some processes stack and then if it tries to run into another process Could say no and then you overrain your stack and just get rid of it. All right So so far it kind of works any other issues we can think of Okay. Well, what about something you might not have thought about global variables? so Most of you probably don't know how global variables work. Well How they work is when your compiler creates that program Well, that program is just sitting there and Any memory it accesses the compiler has to know about and give an address So if you have a global variable the compiler just needs to pick an address for it For each variable, whatever you compile it, right? So say you have a global variable x the compiler might decide that hey that should be at address 1000 So anytime I access the global variable x it actually corresponds to address a thousand And that's it So that might be okay If we had like some global registry of addresses Maybe so we could say hey chrome. You're allowed to use address 4000 and up Firefox you're allowed to use address 6000 to 7000 something like that But would there be any Real bad issues with that? Yeah Yeah, well one big problem is That's just kind of a contract if you just make your own program and say hey, I'll just access, you know address 5000 or whatever then you could access each other's memory that wouldn't be good Another thing would be that hey because you have to set aside certain addresses for each Process and they have to be independent and known ahead of time Well That space is still used even if that process isn't running So if you said hey, you know chrome you get address 7000 or whatever. I said 4000 if chrome isn't running No other process could use that address because you don't know if later They might start chrome and then there'd be a conflict and you'd be fighting over the same memory address And it wouldn't be great So Here's what it would probably look like if we could say hey You know we could Have room for two processes to just use whatever memory they want for global addresses And we'll just make sure that Two of them aren't running at the same time. Maybe that's probably a bad solution. But hey, it's a solution And then you know here's where the size is so Programs have the same amount of space for the stack But they could have Any number of global variables they want or use any memory at runtime they want So that's where the whole memory usage discrepancy is going to come into play like Hello world is not going to use the same amount of memory as chrome running, you know 165 tabs open where it uses gigabytes and gigabytes of memory So That's not going to work whole lot of issues Anyone think what might be a good solution to this memory problem if Sharing physical memory is a pain in the butt. What did we learn so far? Yeah Virtual memory will this Virtualize it. So whatever we're trying to share We'll just stick the word virtual in front of it and make sure that means that each process if it has Virtual memory even if we're not quite sure what that entails If each process has virtual memory We should even knowing that one sense thing Know that each process would have its own independent view of memory and then suddenly all these problems go away so if each Process has its own independent view of memory and it can't monkey around with each other's memory addresses And all that fun stuff all the issues kind of disappear Oops And there's also a more fun problem that comes up. So Having multiple processes that are different Is way easier than having multiple processes of the same program So here's a simple little program All it does is Let's switch to this Oops All right. So here's our simple little program. Hopefully everyone can read that. Can you read in the back? Okay? Yeah, okay So here's our simple program. It creates a global integer called global initialize it to zero And then in main it will create a local variable called local We We are so clever with names and That's it. So the global variable is a global variable the local variable is allocated on the stack and then In the program we have a while loops a while one just means this loops forever So all we do is increment local increment Global and then we're just going to print out its value and then the sleep function just Puts this process since we can now say the word process puts this process to sleep Where it doesn't execute or do anything for one second and then later the offering system can go ahead and execute it again So now if we run this Well here it's running Counting up and then I can switch over to a different terminal and I'm running two of them at the same time So now this one Is counting up. It's at what five six seven and this one's already at 16 So there's two processes. They're both running the same program But clearly they're independent of each other because they're have different values And they're not mucking with each other if they didn't use virtual memory and There was just physical memory that global variable would have to be shared And if one changed it the other would change it So if this said 41 then this one would also say 41 instead of like 35 when I switched to it All right, any fun questions with that or anything you want me to do for this So there's some experiments you could do. Yep. Yep. Yeah. So both of these processes As far as each process is concerned it has access to all the memory and it has its own cpu It's running on so The operating system maintains that illusion but to that process right whenever you wrote hello world You thought there was one cpu. You thought you used all of memory. That was it So you might not have thought of it before of running two of the same program at the same time, but You can kind of explain that there's some magic happening here It's sharing the cpu by probably switching back and forth between them And doing some time something to maintain some virtual registers And they're also not interfering with each other in terms of memory. So there's probably something like virtual memory We can do this experiment, but it's not going to work as well as I thought So we can actually see their addresses So if we want to be sadistic instead of printing out their values We can print out their addresses and see Although this isn't quite going to do what I intended it to do, but let's go ahead and try it anyways So that's just a warning that we don't have to care about So if I run here, I get two addresses And I will switch over quickly run here and get two addresses So I'll just stop them and I can see that the local variable is at this Random looking address And let's see if they're the same between them. So this is six nine Six c and if I switch over to here kill it and go up It's clearly different. It is zero three fc so They could be different actually different physical addresses We're not quite sure by looking at this whether they're virtual or physical So that's probably kind of a lame test And then this global variable is zero zero four four and if we look here we get zero zero four four They look kind of the same. They're not really the same. So this one after zero zero four four There is a c a and for this one it's a db But they look suspiciously more similar so And spoiler alert if I turned off some setting I forgot to do it the beginning of the first lecture When I printed off the address of the global variables between the two processes running at the same time If I change the setting And I remember to do that they would have actually been the same address Which usually breaks people's brains because there's two things running at the same time But hey, we know that there is some type of virtualization going on here So any questions about that Don't worry if it gets slightly confusing because we're going to explain all this by the time The course is done and you will all be experts Okay, so what did we find? well We found that the address of the local was not the same between the two processes and we found that the address of global Was kind of similar but not the same between the two processes So Yeah, it definitely needs It needs virtual memory, but this doesn't really illustrate it Again because I forgot to turn off some setting But ideally the global addresses would have been the same between the two processes And they will have still behaved completely independently and nothing will have gone wrong between them So this is where we can add virtual memory to our picture of a process And suddenly everything we know about it is now virtual So a process would have its virtual registers so that it can execute independently of another process without being interfered with And two it would need some virtual memory so that no other process again can interfere with it It can pick its own memory addresses It thinks it has complete control over memory And that makes it really it makes it a lot simpler to compile If you happen to write a compiler, you know in fourth year You're going to love virtual memory because Finding addresses is just you picking a number of a hat and saying this looks good to me I'll use that and I'll let the operating system figure it out Unfortunately for you that I'll let the operating system figure it out is this course So you will be the one that figures it out So the stack and the heap are both in memory. They both be in virtual memory again I'll harp on this again that each process would have its own independent view of memory So that you can't monkey with another process And I'll also show some example code from this class So all of the code will be in the materials repository located there It's a clickable link if you download the pdf If you have signed into GitLab and I've created a repository for you which will give you an email then you have access to this If not, I will have to give you access to it Whenever you sign into the discord So so this is the instruction if you want to compile the code So you go into the directory for the lecture of the code you want to see You type meson setup build and it will create Build directory for you which sets up all the compilers and does all that stuff for you So you might have used make or something like that before This is a more readable version of make that is not a complete pain in the butt to write if you ever have to write your own build files. This is a lot simpler And then to compile you just Do meson compile dash capital C And then give it the build directory and it will run the compiler for you And link everything together if it's more complicated than that and do all that fun stuff And then there'll be a bunch of executables in a build directory So here for the first lecture, there's like a count example and then read four bytes and At the end you'll get a executable called read four bytes So let's dispel some magic and kind of look at this. So this is Okay, if this code is a bit scary right now I will run through it and see how much of it you're familiar with I expect you're not going to be familiar with A bunch of it So Thankfully it starts off with main if you don't know that starts off with main you are in deep trouble Yikes That's the part you should know and then pass that we're going to see the The arguments passed in it checks the length of the arguments. That's what argc is It's looking for exactly two arguments if there's not exactly two arguments It's going to just exit. So everyone familiar with that up to this point Hopefully that doesn't look Yeah, so At main we're dealing with these two arguments here This integer is the number of arguments and this is just an array of strings And argc says how many strings are in this array? I see a very confused So it's an array of character pointers Yeah, so character points and strings if you're in the c world, they mean the same thing So I'll use the word string and character and character pointer fairly interchangeably So this is an array of c strings. I'll call them c strings then So this is an array of c strings and this is how many elements are in the array So I checked for two always Which we will learn is just kind of a convention The first argument is the name of the program like the zero with argument. It's supposed to always exist That is not necessarily true because that was the result of that That not necessarily being true was the Caused a very large security vulnerability, which we'll see at the end of the course, but hey fun fact And then here We're expecting the argument to just be a c string. That is a file name And all this code will do is open a file and then read the first four bytes from that file I expect none of you have used open before but pop your hand if you used f open before We got a few Okay, we have a few how many of you have written programs that interacted with files at all Okay of you that have not used f open. What did you use? Yeah C plus plus so f streams and stuff like that okay, so Under the hood So as long as you're running on macOS or linux, it's actually doing this whether it's c plus plus c javascript whatever if you're interacting with files This is what eventually it will boil down to so If you used f open It kind of looks the same to this you give it, you know an argument You give it a file name and you get a file pointer back But that is just an abstraction from the c library because The standard c library needs to work for windows mac linux everything. It's meant to work for everything which is And to do that it abstracted a file to a file pointer And then it changes the actual implementation of the file pointer when it points to base off whatever operating system you're using So specifically for this course will be explaining things in terms of linux But mac is most things apply to a mac as well And windows is whole whole another can of worms, which is awful So eventually once you get into software development, you will hate windows. It took me until my fourth year again To hate windows and stop developing for it because it's a mess and you can't explain anything, but Hey, we're going to use linux So Open will open a file It just gives a file name and then this weird Number this magic number Just says I want to open the file to read from the file. That's all it gets And if you used f open it would return a file pointer Which is supposed to be a handle to that file On linux or unixes You don't get a pointer you get a number back So you get something called a file descriptor which we'll explain in the next lecture a bit more But basically you just get a number that represents that open file And at the end of this course you'll be able to exactly know what that number should be But for now just a number We're going to have some function that checks if that number is valid So you don't have to worry about this Most of it will be like reading api documentation to see What valid return values are but for this I just have a helper function to check for errors and then here So we create an array of characters of size four You should know all about arrays if you don't know about arrays you will have a very bad time Also, you should probably brush up on linked lists if you don't know about linked lists They're used all over the place in offering systems as well So this declares a four character array called buffer and That's it. So it's four bytes long and It would be at a memory address and that would be valid for four bytes If you go over that four byte limit you're you know Playing within valid memory and bad things are going to happen And it's not going to be good so on macOS or linux to get information out of a file there is a function called read You tell it what file descriptor you want to read from which represents that open file So it needs to be the same of whatever we got from open And then you give it an address where you want to start writing bytes to And then this argument is how many bytes you want the offering system to write to that array So in this case, I use size of buffer which should be four there. It's four bytes long So I tell the offering system you can start at the beginning address and you can write up to four bytes So it's going to return the number of bytes. It actually Wrote to that buffer. So that's how many bytes you can successfully read from it that are valid So I will check for an error. If not, I'll say the read failed And in here I have a for loop again, you should definitely know how for loop works it will Iterate over every index that was read So zero all the way up to bytes read which is hopefully it read four bytes So zero one two three each time through the loop It extracts a character from that buffer. So first time through the loop It's zero then one then two then three And then it's going to print it out. So this you might not know So strings are all ASCII encoded. So what this Does is take advantage of the magic numbers in ASCII So if that byte is any number between 32 and less than 128 It means it can actually print it as a character that you can see and understand Like a b c d whatever Or whatever and if it can't print the character What it's going to do is just print the value of the byte. So in hex So we can play around with this and dispel some magic because The ultimate magic is This is hello world So this is a fully functioning program that you can execute as a process And what this process will do is print hello world And it is only 168 bytes and it works Which is kind of amazing but kind of Silly how simple it could actually be because that's actually not that many bytes I for Fun you can go compile hello world and see and see how big that file is And compare it to this and tell me if you could ever explain how hello world actually works I'm guessing the answer is no and we'll explain this in the next lecture but First since we have I guess a minute we can Use that read for bytes for a bit of fun And I promise this is not a coincidence so we can look at Read for bytes So we can actually look at that file and I will do this quickly Oh my So the first four bytes of that file are 7f which is some gibberish and then the letters Elf which I swear it does not involve me at all. It just happens to be coincidence and This is the magic of operating systems all that means is if the first four bytes of that Of a file is that it means it's an executable And your operating system would try and execute it so you can run this on any program your hello world It's going to look the same And that's fun. All right, so that's it See you next lecture


Welcome to the World Summit on the Information Society 2017. I am delighted to be joined by Robert Pepper, Head of Global Connectivity Policy and Planning at Facebook. Thank you very much for joining us. Oh, it's a pleasure to be here. So I'd like to start with a quote from your CEO and founder, Mark Zuckerberg. He said, connectivity is a human right. Why is connectivity so important? Well, what we know is that about 3 billion people on the planet are connected, but over 4 billion people are not. And we know that as the world becomes digitized and everything becomes digital, Facebook's mission is to make the world a more open and connected place. And there's been a lot of work done here at the ITU over many years. We know, and the World Bank, for example, we know that as people get connected, it improves their lives both in terms of social benefit as well as economic benefit. Oftentimes, you just talk about the economic benefits, which are extremely important. But we also know that there's enormous social benefit from being connected. It saves times, provides education, health care, brings families together, allows family and friends to communicate with each other over long distances. So it's just an enormous benefit that we take for granted. But if half the world is not connected, we can't take it for benefit. So what are the main barriers to having a fully connected world? So that's a really great question because we've looked at that because we are on a mission to provide connectivity for the unconnected, but also to improve connectivity for what we found to be the under-connected. When you look at it, most people on the planet today are connected by a wireless device. So it could be your mobile phone. It could be a tablet. It could be your laptop. And especially in the developing world, it's the wireless device, usually the mobile. But it could be something connected to Wi-Fi. So in order to connect people who are not connected, you're going to need more spectrum. So that's one of the things, and that's kind of obvious. But there's another piece of this which we are focusing on. I work with our engineering team. And we're very sort of strategic understanding gaps. So when we look at the parts of the world, 95% of the world has access to GSM phones, narrowband data. That's not really the internet. In order to be connected to the full internet, you need 3G or 4G, spectrum is part of that. But it also turns out backhaul is a problem. And so we're working on that. And we look at the world in a very systematic way to identify gaps. In low density areas, satellites are great. By the way, we have no technology religion. It's very technology neutral. So we'll work with satellite operators, where there's medium density in places like sub-Saharan Africa, where there's no infrastructure. There may be a mobile operator, but it's narrowband. You can upgrade the tower, the antennas, to advanced 4G. But if you don't have good backhaul, you can't use a smartphone. You can't do data. You can't be on the internet. So we're looking at developing technologies for those medium density areas. We have a project called Akila, which is using unmanned aerial vehicles. It'll fly at 20 kilometers up above all the weather. They will connect to a cable landing point, beam up by radio. And then these UAVs will connect by laser beams. And then when they're over a medium density group of villages or a community, beam down by radio again. So it's providing. And by the way, it's not to the end user. It's going to go to the community Wi-Fi point, go to the mobile operator's tower or the antennas. By the way, we're doing this. We have no intention to be the operator. We're inventing these technologies. I tease our engineers. Some of them are turning science fiction into reality and then make it available to others to use. We're working on another solution in high density areas, places where there's, for example, a large city in India or Brazil or any place where you have high density populations. There's mobile connection for 2G. How do you get the backhaul, the fiber type of connection to that community? It's not going to be fiber for a long time. So we're working with technology, super small cells using what's called the V-band, which the radio folks at the ITU understand. Working with them, they're great. And with new very high powered processors and smart radios, beam-forming antennas, using radio to create virtual fiber backhaul connections. Again, for each one, and make that available, by the way, to operators and third parties. So in each one of these, it's understanding what the gaps are in the existing infrastructure, architecture, and technology. And as a result, fill those gaps and make it easier for either the mobile operators, the community Wi-Fi operators to be able to get what they need to provide the connectivity. Many of the UISIS participants I've spoken to have stressed the fact that connectivity is not just about technology. It's almost a collaborative project, isn't it? What do you make of that? So we just did a really interesting study with the Economist Intelligence Unit. We looked at 75 countries across the world in what's really a beta test of time zero when we're now working on the next version, which will be 125 countries. And there were 46 indicators for every one of those countries. And what we found was that when you're looking at connecting and using the internet in a meaningful way, benefiting from the internet, we call that internet inclusion. And we found that there were really four components of that. The first was availability, the connectivity. But that was only the start. You also had to, we looked at one of the other major variables was affordability, has to be affordable. And then there was relevance and readiness. And so you look at it that way, it's not just about the infrastructure on the supply side. It's about the content, relevant content, local content and local language. It's how do people use this internet to benefit in a meaningful way? That's internet inclusion. So it's all of the above. The connectivity layer is only the enabler. It's the necessary but not sufficient. You need all of the applications on top of that. And that's where you get the benefit. Robert Pepper, head of Global Connectivity at Facebook. Thank you very much. Thank you.


It was a little bit hectic in my getting here on time, so I do apologize. But thank you for all being here tonight. Myself and the Snowden refugees, Mr. Snowden, we really appreciate your attendance here, the people watching on live stream, and the support for my clients. And just very briefly, in case there are a few people out there, I met Mr. Snowden in 2013, June in Hong Kong, and that's when he made the globally significant disclosures of the Five Eyes Electronic Mass Surveillance Program. And it was at that time that I represented Mr. Snowden in Hong Kong, and thereafter, and it was also at that time that I asked four brave adults, incredibly courageous adults who exercised decisions of conscience to provide Mr. Snowden with a refuge, with shelter, humanity, compassion, and caring. And to introduce them again briefly, Vanessa on the left, if you're facing the screen, from the Philippines to her right, to her left, Ajith, military deserter from Sri Lanka. Nadeeka from Sri Lanka, and on the far, far left, Supun from Sri Lanka. And these are the three children. On the bottom left is Kiana, and beside her is her stepsister, Satyamdi, and Supun is holding the little boy, Dinaf. What I'm going to do this evening, before providing a brief update on the Snowden refugee status, I'm going to go through a bit of law. I think at this stage there's been such marginalization, demonization, confusion about what refugees are and what is required to qualify as a refugee. I'm going to go through a number of international law, and at the same time, beyond that, I'm going to go through what's happening globally. And in my view, we're really at a crisis in terms of authoritarian leaders, democratically elected, and ignoring their constitutions, violating them, blatantly ignoring the international law. So very briefly, I've just listed some of the most crucial or core conventions that protect human rights, from the UN Universal Declaration on Human Rights to the UN Convention Against Torture, and of course the UN Convention relating to the status of refugees in its protocol. I'm also mentioning the Rome Statute of the International Criminal Court, because this is a court where this court itself is now being attacked by states around the world, nations around the world. I'm also mentioning customary international law, which is an international norm where due to practice, the practice becomes so pervasive that countries no longer need to sign up to an international treaty. That treaty becomes part of customary law, it doesn't have to be written anywhere. Now, the core document I'm going to discuss is the Refugee Convention in Article 33, and subparagraph one is the core part of refugee protection, and that is no state shall expel, return, and the legal word is refowl, okay, means to return. So no state is going to, should return any refugee, and that also includes any refugee claimant out of their jurisdiction where their life or freedom are at risk. And that, the life and freedom also includes any serious harm. And there are five fundamental grounds to secure refugee status, race, religion, nationality, and political opinion. These are the classical four. There's a fifth called social group, and it's not a closed end category, it's actually open-ended, because as, you know, over time we recognize that different human rights abuses occur affecting different social groups that don't fall into the four classic categories. So just a review, just to interpret Article 33, as I mentioned, liberty and life also includes serious harm. It's a forward-looking test. So if an asylum-seeker or refugee crosses a border into another country, they don't need to prove that they actually suffered any harm or any threats or any risks. Any threats or harms or loss of liberty or serious harm before they leave their jurisdiction into another jurisdiction. That person has to show they're unable or unwilling to seek help from the police or the state, and that's quite often the case because of corruption or the state itself is the persecutor. And there must be a nexus to one of the five grounds. I'm going to focus on political opinion, and political opinion can be expressed by an individual verbally through their physical actions, the presence with others. And political opinion is connected to the right of freedom of expression. And one thing I would stress is that freedom of expression under the law is not just your right to say something. It's also your right to receive information, to be present, to be able to hear and listen or record. And the freedom of expression connects fundamentally to freedom of association, assembly, and mobility. A lot of people misunderstand that persecution for political opinion is that the opinion comes from the persecuted person. In fact, the Refugee Convention clearly states it is the opinion of the persecutor that counts. So for example, I've had clients from South Asia. One case was of a farmer who just had no political opinion but was at a rally in a public place and just was standing on a corner and was unaware there was a political opponent standing near him. Those in power saw my client inferred that my client must be supporting the opposition and from that day onward persecuted him, burned down his house, destroyed his farm, and he fled for his life. So the legal test is the opinion or the perception of the persecutor. Now I'd like to go to the social group category. This is really important because this relates to some of my clients and in particular the Snowden Refugees.  These characteristics are typically historical and relate fundamentally to an individual's identity and conscience. Usually they're unchangeable and if they're not unchangeable, that person should not have to change those characteristics because they are fundamental to their identity or conscience. If they can be changed, they still should not be changed because they're linked to that person's fundamental exercise of human rights. The Snowden Refugees fall into the social group category. Aside from having claims with Hong Kong and the Canadian government under political opinion for supporting helping Mr. Snowden, they form the unique social group that I think everyone in the world recognizes. They are the Snowden Refugees and the social group are individuals that protect whistleblowers. That's the social category. One thing I'll stress is that we hear about whistleblowers and public support for whistleblowers that protection, public support for journalists to carry out their duties quite often working or reporting what whistleblowers want to disclose. But there is not enough in terms of legal applications, there's not enough in terms of public awareness the importance of the average individual on the street, anybody on the street who may one day be faced with what the Snowden Refugees were faced with and make extraordinary decisions of conscience to help a whistleblower. I'm mentioning the CAT Convention, the United Nations Convention on Torture. Torture is a non-derrigable right. Not to be tortured is a non-derrigable right. There is no circumstances that exist that can justify any state or private party torturing an individual. And I also mentioned the International Covenant on Civil and Political Rights and the three core rights here are the right to life and that it should not be arbitrarily taken. Tortures repeated here but also cruel and human or degrading treatment or punishment. And this is a non-derrigable right. No one should ever be subjected to this.  And as we see globally today, countries are around the world where there's mass protests against government corruption, government abuses, a lack of freedoms.  Now I need to mention or point to the Universal Declaration of Human Rights and in there, as well as Article 31 of the Refugee Convention, that every refugee claimant has an absolute right to cross a border if they're at risk of losing their liberty, their life or serious harm. And unfortunately, we're living in a world today where countries that are around the world are putting up walls that are real, walls that are virtual, because they do not want to address or comply with their international obligations to help the most vulnerable. And what nation-states are doing is they're using propaganda, inaccurate information, false information to criminalize legitimate asylum seekers and refugees, to try to categorize them as illegal immigrants, economic migrants. And with all of this, we're seeing an erosion of international law and constitutional law. And one area where nations have been very clever is they've been using a strategy of constructive refalement. Now, refalement means to return. And in Hong Kong, for example, the government achieves constructive refalement, which basically means they create an environment that makes it intolerable for an individual to remain in that jurisdiction.  So in Hong Kong, for example, the government does not provide full humanitarian assistance, they criminalize work, there's no education allowed for adults. And employment is prohibited, so that there's no way for the individual to be making money or participating in a meaningful way in society. And in the end, that person becomes so compromised, they decide to leave. So the governments create these circumstances to violate their constitutional rights, international legal rights by making them leave, by making the circumstances intolerable. You're seeing a global trend of criminalization and ill treatment of asylum seekers. You've seen similar legislative and policy and propaganda frameworks in Austria, Denmark and Hungary. We've all seen the asylum seekers who've lost their lives crossing the Mediterranean. In the United States, we've seen separation of children. Separated from families, a tactic used by the US government. The children held in detention centers deprived of blankets, soap, toothpaste. A lack of monitoring and care for the welfare and health of these children, some have died. And more recently, and this is a tactic also used by the Hong Kong government, but in a different way, asylum seekers who are outside the US jurisdiction, the immigration officers put incorrect addresses recorded in the system so that they cannot receive legal notifications from the US government. You've seen the same thing in Hong Kong. On our first hand, I've seen asylum seekers go to the immigration and removal assessment section, try to hand in a document stating that they're raising a claim as a protection claimant for refugee status or torture. And there are security guards at the door that tell them go away, it's not acceptable. Not immigration officers.  So these are tactics that deny what I would describe the due process rights of these vulnerable groups. And I do want to mention Thailand in terms of the treatment of asylum seekers and that they have found mass graves and Thailand has been complicit in human trafficking of the Rohingya. Now there's a few quotes I'd like to read and this is from the former UN High Commissioner for Human Rights. And it was right for us not just to have remembered Mandela's greatness but to have almost unconsciously contrasted it with all the narrow politicians who continue to proliferate across the face of the world. Authoritarian in nature, many of them are wily political infighters but most are of the thin mind and faint humanity. Prone to fan division and intolerance and just for the sake of securing their political ambition. While some do this more openly than others, all are well aware what they practice comes at the expense of vulnerable humans. And the UN High Commissioner goes on to state, to them I say you may seize power or stubbornly hold onto it by playing on and stoking the fears of your followers. You may congratulate yourselves for this and you may think yourself so clever for it but we know all you've done is to copy the behavior of previous generations of once strong but ultimately catastrophic leaders and politicians. Yours will in the end become a mouse-like global reputation, never the fine example of the leader you think you are and never even close to a Mandela. To deserve global respect you must begin to follow his example committing to the spirit and letter of the Universal Declaration of Human Rights. Hong Kong does not recognize the Universal Declaration of Human Rights. Hong Kong doesn't recognize the UN Convention relating to the status of refugees. Michelle Bachelet, the current UN High Commissioner, she stated earlier this year, the report outlines our efforts to assist states to uphold all human rights at a time when humanity faces many serious challenges.  Ms. Bachelet continues focusing on these inequalities and I'm just going to read at the bottom. Yet in several cases they are being met with violent and excessive force, arbitrary detentions, torture and even alleged summary of existential killings. People are protesting, people are protesting at the behavior of government and authoritarian leaders. And I put my mind to how to describe what's going on and the best way I've been able to describe it is that these authoritarian leaders, democratic elected have become unhinged, disconnected from the populace and most recently Ms. Bachelet has talked about global protests and she stated just a few months ago, I fear that we are moving further away from the global solutions to global problems due to two clear trends that are taking us in the opposite directions. Today in places with very different circumstances, level of development and political situations, we're seeing an outpouring of popular discontent and mass protests or their suppression with the firm hand of the state. In every region and Hong Kong's included in here and I'll just move forward, we see the desperate need for dialogue. The use of unnecessary and disproportionate force against people holding dissenting views and arrests of individuals exercising their rights to freedom of expression and peaceful assembly can only exacerbate tensions, seriously undermining the space for dialogue. In my view, we are in crisis, there is a global crisis. What I thought I would do is to give some tangible examples through the case work I do. Narendra Modi, his platform has been Hindu nationalism and that's been at the expense of religious minorities and ethnic minorities in India, in particular the Muslim population and what Modi has done and this is a thread that runs through what happens in other jurisdictions including Hong Kong is when you have nationalism and minorities are targeted by the government or they're discriminated against, third parties in the private sector or related to politicians act on their own and when the state allows that to happen, we call that state acquiescence and in India, that's what we're seeing. Just coming back here, recently there was a deprivation of citizenship of 1.9 million people in a Sam state, an arbitrary act by Modi's government and as of last week, there was a new bill enacted into law granting citizenship to Hindus, Buddhists and Christians from certain South Asian countries, but it excludes Muslims and it also excludes the Sri Lankan Tamils for which there's a huge number of refugees who had fled from Sri Lanka and what Modi has done is all contrary to articles 15 up to 28 and that's prohibition of discrimination based on religion, race and place of birth. The tactics used by governments today in doing what Modi has done, it's being used all over the world. The executive branch or the legislature passes legislation that's unconstitutional and it may take a year or two or three years before a court strikes it down but during that gap period, those people who are discriminated against or persecuted suffer.  So this is another way that Democratic elected leaders are utilizing the government and the legal system to strip away constitutional rights and rights under international law. Sri Lanka, extraordinarily good by a Rajapaksa, accused of war crimes, crimes against Manila and genocide was elected as Sri Lankan's new president just a month ago. In 1987 to 1990, he was the commanding officer in charge of the Mathalay district where about eight years ago they found mass graves. In 2009, he was accused of war crimes, crimes against humanity and genocide. At the end of the war, bombing hospitals, civilian hospitals where there were Tamils, extrajudicial killings, summary executions. It's, and the platform of Rajapaksa was based on ethnicity and nationalism and the Philippines. Didarte came to power in 2016. It was on the platform that he would carry out mass, extrajudicial killings against drug addicts and drug traffickers. He had done that when he was mayor of Davao city in southern Philippines. And in June 2016, when he took power as president of the country, he did exactly that to over 20,000 Filipinos executed. The president of the Philippines, the government have threatened NGOs, human rights activists, ethnic minorities, Catholic church and even UN special rapporteurs. And stunningly, Doarte was actually filmed, this was televised, where in his campaign and basically committing crimes against humanity, he said if Germany had Hitler, the Philippines would have, he said pausing and pointing to himself. Hitler massacred three million Jews, there's three million drug addicts. There are, I'd be happy to slaughter them. And a year later, Donald Trump congratulated Doarte on his war on drugs. UN special rapporteur on the rights of indigenous people, Victoria Tali Corpus, she fled the jurisdiction because Doarte put her name on a terrorist list. This is about state acquiescence to human rights violations. When a government puts an individual's name on a list and what happened in the Philippines, private parties took the law into their own hands and executed a number of people, assassinated them. So that was the fear for the UN special rapporteur and she fled the jurisdiction. Complaints were filed with the International Criminal Court for crimes against humanity against Doarte. And also this UN special rapporteur, Agnes Calamard on summary and extraditional killings. Both the International Criminal Court prosecutor was threatened by Doarte and also the UN special rapporteur. Most significantly, the ICC prosecutor was threatened with arrest if she came to the Philippines to investigate. She'd be assaulted and she'd be killed. She'd be fed to the crocodiles. Philippines officially withdrew from the International Criminal Court, but that still does not protect President Doarte. Doarte may have committed possible war crimes. I've mentioned a few here, particularly calling for horrific crimes to be committed against women. And the People's Republic of China has been a great supporter of Doarte and it's understood that because of the provisions under the Rome Statue for the International Criminal Court that Doarte would not be prosecuted, China would use its veto power in the International Criminal Court to prevent any prosecution of him. Again, this is an example of how states are interfering with violating or making international law useless. The People's Republic of China, the most pressing example are the current concentration of Chinese military detention camps in China of the Uyghur Muslims. And despite the China cable satellite images and witnesses, China denies that they've arbitrarily arrested, arbitrarily detained, and disappeared over a million Uyghurs from Xinjiang province. I'd like to mention Hong Kong very briefly. And Hong Kong has had a history of violating the Constitution and international law from the Samuel Sadie extraordinary edition where Hong Kong deprived Mr. Sadie of all his due process rights and his protections under international law and handed him over to the UK and US government on a rendition flight in 2004. And that was the incident that put fear that made, that gave me great concern when Mr. Snowden was in Hong Kong. That the Hong Kong government could not be trusted to uphold its constitution, to uphold international law. 2014 Occupy of Protests, Ken Zhang, a politician, he was hog-tied, hands tied behind his back and his legs and tortured by the police and it was caught on video. And these officers were convicted, but then the police compared themselves to being persecuted as the Jewish people had during the Holocaust and that's on video that's been publicly recorded. And 2018, Alan Lee and Ray Wong fled Hong Kong in fear for their liberty and their safety and they were granted refugee status by the German government, which was the right thing to do and this caused a lot of outrage of the Hong Kong government and Beijing. And right now we have the Hong Kong protests, including arbitrary arrest, arbitrary detention, cruel and inhuman degrading treatment and punishment, torture, enforced disappearances, cases of rape by the police and actual extra judicial killings. I'm going to skip this. I still have clients, my clients in Hong Kong, the Snowden refugees. And fortunately this March of this year, Vanessa Rodell and her daughter, Kiana, safely arrived in Canada having been granted refugee status. This was a seven and a half year battle, seven and a half years. And the one thing I'll say is that so many people gave up, so many people said to me, you're not gonna win, it's taken too long, why don't you just move on with other cases? Anyways, I believed that we'd be successful and we have Kiana in this photo. This is Kiana on her father's lap and her father is still in Hong Kong with her brother and sister, Setem Di and Dinaf. And we would like to see this family being reunited in Canada. And we're asking Canada to act fast, as fast as possible. She has a sister who only thinks about, in Hong Kong, Setem Di, who only thinks about being reunited with Kiana in Montreal. And at this time with the police abuses, the government abuses in Hong Kong, Setem Di has been traumatized and she suffered permanent damage. The whole family is afraid, they live in fear and they are at heightened risk with the lawlessness in Hong Kong. The lawlessness by the Hong Kong police. I just wanna share this picture, which was taken by Jane Russell in August this year. This is the Hong Kong police tactical unit in Fanling. And you'll notice that there's no Hong Kong flag. And Jane Russell photojournalist pointed this out and it was at that point, we all realized that the hand of Beijing was apparently acting directly inside Hong Kong, directing the Hong Kong police. What's happened in Hong Kong is the same thing that you see in Sri Lanka, in Bangladesh, Pakistan, India. Where the government allows the police to commit abuses.  And that amounts to state acquiescence. And what's happened in Hong Kong is what you see classically in Sri Lanka, or the Philippines. Where third private parties take the law into their own hands and go after innocent civilians or peaceful protesters. Hong Kong has become a very dangerous place today. And my clients' lives are at risk, at a heightened risk. I thought I would share this image taken by Kiana's father of, set them the Indian flag. The Nath during the protests. And this is what these children are growing up in this kind of environment right now. Where, really where they should be, is in this environment. And this is Vanessa and Kiana in Montreal, Quebec. No, just earlier this month. Now what I'd like to do in saying that is I'd like to invite Mr. Snowden to join us. Can anyone hear me? Thank you. We have very little time. So let me first give thanks to Robert Thibault. I know it's not always fun for everybody to sit through what is effectively a long lecture about what's wrong with the world. But these things matter. And it's important that we remember how they get better. I've been thinking a lot this year in writing my book, Permanent Record and After, about the state of the world and the direction of our future. I trust that each of you will understand that in 2019 this was not an especially enjoyable activity. But it's necessary. And one of the bright spots for me in this increasingly dark world has been the fact that people like you, that CCC has supported these families over the last few years, they made a difference for me. Think about what would have happened if I wouldn't have been able to get off the street. Think about what might have happened to me. I think about the fact that I wouldn't be able to talk to you today in all these years since the book that I wrote would not exist. It might seem like a small thing to you to give a donation to help out. But I believe that it really has genuinely changed the future of these brave families in a positive way. And so when I'm thinking about everything that's broken in the world, it got me thinking about the lessons that can be taken from that and how they fit into a larger framework. We have a pretty limited time here so I'm gonna do something a little bit unusual to try to summarize and read a little passage from the book. What makes a life? It's more than what we say, more even than what we do. A life is also about what we love and what we believe in. For me, what I love and believe in the most is connection, human connection, and the technologies by which that's achieved. Those technologies include books, of course, but for my generation, connection has largely meant the internet. Now, before a lot of you recoil knowing how broken the internet, the toxic madness that's all over it, understand that for me, as it was, for I believe many of you, when I came to know it, the internet was a very different thing. It was a friend and a parent. It was a community without border or limit. One voice and millions, a common frontier that had been settled but not exploited by diverse tribes living amicably enough side by side, each member of which was free to choose their own name and history and culture. Everyone wore masks and yet this culture of anonymity through polyonomy produced more truth than falsehood because it was creative and cooperative rather than commercial and competitive. Certainly there was conflict, but it was outweighed by goodwill and good feelings, the true pioneering spirit. You'll understand then why I say that the internet of today is in many ways unrecognizable. It's worth noting that this change has been a conscious choice, the result of a systematic effort on the part of a privileged few. The early rush to turn commerce into e-commerce quickly led to a bubble and then just after the term of the millennium to a collapse. After that, companies realized the people who went online were far less interested in spending than in sharing and that the human connection the internet made possible could be monetized. If most of what people wanted to do online was to be able to tell their family and their friends and strangers what they were up to and to be told what their family friends and strangers were up to in return, then all companies had to do to figure out how to put themselves in the middle of those social exchanges and turn them into profit. This was the beginning of surveillance capitalism and the end of the internet, as I know it. Now it was the creative web that collapsed as countless beautiful, difficult, individualized websites were shuttered. The promise of convenience led people to exchange their personal sites which demanded constant and laborious upkeep as you all know for a Facebook page and a Gmail account. The appearance of ownership was easy to mistake for the reality of it. But few of us understood it at the time. None of the things that we'd go on to share would belong to us anymore. The successors to the e-commerce companies that had failed because they couldn't find anything to sell that we were interested in they now had a new product to sell and that product was us. Our attention, our activities, our locations, our desires, everything about us that we revealed knowingly or unknowingly with or without consent was being surveilled and sold in secret so as to delay the inevitable feeling of violation that is for most of us arriving now. And this surveillance would go on to be actively encouraged and even funded by an army of governments greedy for the vast volume of intelligence that they would gain from these practices aside from logins and financial transactions hardly any communications were encrypted in the early 20 odds which meant that in many cases governments didn't need to even bother approaching the companies that were running these platforms in order to know what their customers were doing. They could just spy on the world without telling a soul. And now I ask you, is this what the world should look like? And how did this come to be? We were there. We were watching. And we thought we controlled the system. We thought we ran the system. We thought it was our internet. But here we are. You know surveillance after all is less about safety than it is about control. And when you look around at the union of technical and political systems today, it seems that they intend less to serve us than for us to serve them.  You know what is hacking? I'm not sure you guys all have different definitions but in my definition, it's not just programming, of course, so we wouldn't see terms like biohacking. Hacking is about rules and the distance between how they are believed to operate and how they operate in fact. Hacking for me means coming to understand a system better than its creators or its operators and using that understanding to produce impossible results. Unexpected behavior. Now we like to think about hacks in a positive light but in the case of these last few decades, it's our society that was hacked. It is the whole of our network. It is the internet itself that they exploited. And see that that's the thing. The choices that we make and the things that you do, they have power and doing nothing, that's a choice. Now a lot of us like to think it's a willing choice. We like to think that we're the sole captains of our own destiny and that's the way it's supposed to be. That's the way it was intended. That's the way we designed the system. And yet the system today, somehow the actors within it spend an enormous amount of energy trying to make you forget that the things you do affect the outcome. They'll tell you not to worry about it, that it's not so bad. After all, it could be worse. But I say to you, it could be better. And every time we hear those words, that's what we need to say. Every system in history, even the most powerful, has been subject to change. And every hack that is performed against us can face a patch and more in all of the trouble to which these people have gone to make the people broadly forget their own power. They have forgotten something that I think is fundamental. We can hack back. They run the system. They may have won today. But I've been thinking about this. Look, we all know the history and it's been a dark time.  Change is coming and it is coming from people who pay attention, people who care. It will come from people like you who took the time out of their day, out of their lives, the money out of their pocket to travel the time, the minutes of your life to be here today, standing in solidarity, talking, learning, sharing to show that this broken world could very well be better. We can change it. We can change everything, one system, one rule at a time. Thank you. Just if it's not apparent, I no longer have audio, so I'm afraid I won't be able to hang on. Ed, we've got Vanessa on the screen, half the screen with you right now. And she's on video live from Montreal. And can you... Just if it's not clear, I can't hear anything anyone's saying. So I'm a bystander now. I'm gonna go to the stream. And hopefully Robert and Vanessa can help us with the Q and A. Ed, do you wanna do a quick Q and A right now? Or do you wanna... We've lost Ed. All right, so, yeah, so Vanessa's in Montreal and I've invited her here today. And so why don't we just start with the Q and A? This is really... It's Vanessa's first year after a decade and a half being under very difficult circumstances. Awesome, you know the drill. We have microphones in the halls. Please line up behind them if you have question for Robert Thibault or Vanessa. And hopefully Mr. Snowden will join us again. I think we're working on that in the background. Do we have questions from the internet so far? Yes, that is the case. So, signal angel, please give us a question. Do you think that whistleblowing could have prevented fascist regimes in the past and that it will be more important in the near future for the same reason? Questions for me, I'm assuming, yeah. Whistleblowing has always occurred in the past and it has brought about change. Historically, there are recorded cases but the difficulties in the past were the lack of protections. Quite often whistleblowers had to leave the jurisdiction. They end up being killed and really it's only in recent history and in particular with Edward Snowden's whistleblowing that governments around the world including the European Union as a whole recognize that there needs to be changed, there needs to be more protections. But we're also seeing that nations are providing enhanced whistleblower protections but on the commercial civil side and they're still lagging significantly where there's whistleblowing outing governments that behave egregiously or criminally as in Mr. Snowden's case. So, more than ever whistleblowing will remain and will continue to be a crucial part of ensuring government accountability and transparency. But for whistleblowers to step forward a couple things have to happen. Society needs to be stepping up and demanding government that there be protections for whistleblowers particularly like Mr. Snowden. And secondly, we've seen the government go after the Snowden refugees and made their lives intolerable, their existence intolerable in Hong Kong. And the delay of so many years to get Vanessa and Kiana's on the screen now into Canada and the other families here in Hong Kong who are suffering right now was the global leadership saying don't protect a whistleblower because this is what's gonna happen to you. So, I hope that Vanessa and Kiana's arrival and refuge in Canada to safety and security is an example for the whole world that there will be more whistleblowers but there also needs to be people in the general population who say look we need to support them and to take steps to make sure whistleblowers can remain safe but also in democratic systems to put pressure on government to make changes in the whistleblower protections. Thank you a lot for this detailed answer. We have some more questions but before we continue with them I would like to ask all of you to stay seated and stay quiet. Some people are leaving already the hall, please don't and please stay quiet so we can enjoy the last minutes of this lovely Q&A. You can also ask questions to Vanessa who played a crucial role in sheltering Mr. Snowden back in Hong Kong and for now I would like to hear a question from microphone number three. Hi, I'm Farhan, I'm a Pakistani journalist in exile. So thank you for the talk, it's been super inspiring. My question to Vanessa is that looking back now that everything that you suffered would you say that if you were given a choice that you could do this all over again and not do this at all, which one would you choose? If I have a chance again, I would say no, no. Everything what's happened, I think I will take this chance because after everything that's happened I'm here in China to save and I'm safe. So there's the big thing about that I would say but I'm very thankful to be here in Canada and as far as I know it's coming support us until we have here in Canada and we could start our new life in Montreal. Can we have another question from the internet? It's a question for Vanessa. How are you settling down in Montreal and has the community received you well? I'm settling in Canada is just like I'm saying because for me it's the hardest for me. People here is very happy here a lot. They're very supportive and if you don't know how to you just ask NGO to help me. Can they hear her? Thank you for this answer. Do we have more questions in the hall? I have a microphone that I can't see you right now. If you do, I think that's not the case. Single entry do we have one more question from you?  I don't know which one of you can answer that but what's causing the delay? Why is the family still separated? Is there any indication why Canada doesn't process the search for asylum? I want to put this on last. The Snowden refugee cases it has been a long delay and it's been too long and at this stage the Canadian government is progressing with the cases and these are complex cases. At this stage that's all I can really say. We all want the other families. We want the two children, Canada's brother and sister and we want to jeathe the former soldier. We want them in Canada, we want them in at the earliest time and this is really the only solution, it's the right solution for these extraordinary people. Thank you. So apparently we have Edward Snowden back. The correction is established again and if there is a question for him then please run to a microphone because that's your only chance. That's probably the last question of this session. Microphone number four, would your question qualify? Yes, I think so. Thank you everybody. My question quick. Mrs. Snowden you said we should put pressure and make change and do you think we should pressure our own government locally or should we pressure our government to pressure other governments? So for example, which sanctions to these countries that Mr. Tybal mentioned, that's the question. Yeah, I think we need to look at where can we be the most effective? This is a difficult question I think for people who are in advanced democracies because you see all the terrible things that are happening all over the world. You see the situation in Russia, you see the situation in China, you see the Russian situation in Iran and North Korea. And of course where you can make a difference I think you always should act. Even in my case there have been things where I have been criticizing of course the Russian government even though I live here, even though it's dangerous to do. I don't think there's much likelihood that the Russian government is likely to listen to me. I don't think there's much likelihood that the Russian people will listen to me in that circumstance because I'm not Russian. I don't speak the language, I can't persuade them. But you can persuade the people that you're around. You can persuade the community. And that's really when we talk about hacking, when we talk about systems, right? The whole thing that they used against us was that they thought, we thought the system, our democracy, our methods of voting, our methods of policing the internet, of managing and sharing our communications worked in a certain way. And how they were actually being used, how they were actually being implemented, how they were actually being operated. In many cases against us that was not clear. In secrecy in many cases was responsible for this. But when you talk about where you can make the most difference, it's in this room. It's the friendships you make that you take with you. It's the networks of solidarity and influence that you build. The sharing of skill sets and cooperation that will allow you to influence people even outside your areas of expertise, going to politics, going to local officials, using the local officials to get to the state officials, using the state officials to get to national, using the national to get to the international. What we have to do is we have to take a hard look at how the world actually operates today. Not how we want it to operate, not how we think it operates, but to measure it, to see how it's actually functioning, to see where the money goes, to see who's using it, to see where the influence is. And in many cases to seize control of that via whatever means that we have available to us. This is where we look at the technical systems that the people in this room have an extraordinary amount of influence over that we may not have in the political realm. If you make a protocol and that gets used around the world, you can provide the same guarantees, the same protection to someone in China, to someone in Russia that they have in Germany. Because technology can be agnostic to its use. If we make these carve-outs, if we make these sort of emissions, if we make concessions to power, to system, to government, to institutions, we have to think about how they will be used. The more rules in a system, the more lines of complexity there are, the greater the unseen attack surface that they can be used against us. We need to design for tomorrow. But there's no time to wait. We need to be working today. And if I could just say one thing, thank you everyone for your patience and for bearing with us through all of this.  But everybody asks, you know, how can I make a difference? This is all very good. It's very abstract. Again, be opportunistic. Look at where you can make a difference right now. And in the case of these families, we are almost across the finish line. We have been in this fight for years, and we are about to win. We can do it with your help. So please, if you can support them, do. Thank you. I have to extend a huge thanks to you, Mr. Robert Thibault. To you, Edward Snowden, thank you for coming on our stream. And thank you, Vanessa, for coming to us as well. This was a lovely event. Mrs. Snowden asked you to help, and this is how. This is how. Robert, if you'd like to say some last words? I would. This has been a long fight. We're in the eighth year now. And there's no way that we're going to get to the finish line unless donations are made, whatever you can help with. If it's a small amount of change, that's fine. If you can donate something more significantly, of course, that's going to help. But it's all about food, rent, utilities. And also, for Vanessa and Kiana and Montreal, the NGO is under legal obligation to continue to support them financially for the first full year that they're in Montreal. And they do need that support. One thing all stresses, the climate has been a big shock for Vanessa and Kiana. And it costs a lot of money to get winter jackets or jackets for autumn, shoes, boots. So at times, it's been rough for them. But one solution is the donations that make sure they have warm clothes and food, et cetera. And of course, the clients in Hong Kong, they have almost no humanitarian support. So if you can donate, we continue to donate. We all appreciate this. And thank you so much.