The Jack Benny Program, presented by Lucky Strike. It is the service of men. Lucky Strike, first again with Tobacco Man. First again with Tobacco Man, Lucky Strike. More independent tobacco experts smoke Lucky Strike regularly than the next two leading brands combined. There you have the findings of a recent impartial survey which reveals the personal smoking preference of the men who really know tobacco. The auctioneers, buyers, and warehousemen. Yes, the survey shows... Lucky Strike, first again with Tobacco Man. First again with Tobacco Man. First again with the men who can see the makers of Lucky Strike consistently select and buy that fine, that light, that naturally mild tobacco. And when these experts smoke Lucky Strike for their own personal smoking enjoyment, then you know... LSMFT, LSMFT. Lucky Strike means fine tobacco. And in a cigarette, it's the tobacco that counts. So for your own real deep-down smoking enjoyment, smoke the smoke Tobacco Expert smoke. Lucky Strike, first again with Tobacco Man. Graham starring Jack Benny with Mary Livingston, Phil Harris, Rochester, Dennis Day, and yours truly, Don Wilson.  A man who's not only love for his... Wait a minute, I must have the wrong script. This is introducing Robert Taylor. That's right, Don. Jack has gone away on a week's vacation and Robert Taylor is taking his place. He should be here any minute. Robert Taylor! Oh, that's wonderful.  Well, it's more than just a trip, Don. Jack is spending a glorious week in New York. What made him decide to go so suddenly? He won it on the bride and groom program. Bride and groom program?  Well, not exactly, Don. But Jack figured here was a way to get a trip for nothing, so he got someone to go through the ceremony with him. But what girl would go along with a gag like that? Mary, what are you laughing at? He couldn't get a girl, so he hired a man with a tuxedo and Jack wore his Charlie's aunt costume. With a veil yet. What? Well, Mary was all a gag. Why didn't he come to you with the idea? He did. That's why he wore the veil. I punched him in the nose. Anyway, Don, till Bob gets here, I think that we... Hiya, Don T. Hello, Livy, you little May company magnolia. Where's Jackson? Well, Jack won't be on the program today. Oh, he won't? What's wrong? Nothing's wrong. He just decided to take a vacation. He needed a rest. Well, it's his own fault. What? He wouldn't be so worn out. No, Phil, Jack doesn't have that much money. He don't, huh? When Jackson goes to the bank to make a deposit, he's carrying so many bags that Teller puts on a red cap and meets him at the door. Phil. And then the vice president grabs a microphone and yells, leaving on track five another load for Fort Knox.  He got Robert Taylor to fill in for him. He got who? Robert Taylor. Oh, you mean Spangler Arlington Broome? How do you like that? What's the matter, Phil? Well, why does Jackson want to get somebody else when he's got me? Why, baby, I'm Radio's answer to the governor of Alabama. Me little Filthy. Yes, that's pretty thing. The kid with the soothing personality. Phil, your personality is about as soothing as an eyewash with Tabasco sauce. So whether you like it or not, Robert Taylor's gonna be on the show. Okay, okay, but if you don't show up pretty soon, I'm taking over. Oh, no, you're not. Oh, Mary, maybe we ought to check and see if Bob has started for the studio yet, huh? Well, that's a good idea, Don. I think I will. And it's the only thing that ever wings at me. Miss Livingston, will you get me Robert Taylor's house? And please hurry, because Mr. Taylor's gonna take Mr. Benny place on the show today. One moment, please. What is it? It's nothing. So Robert Taylor's taking his... Robert Taylor! A box and turnip green. They're talking to a red cat. Taylor being on Jack Benny's program. Yeah. Why, if Robert Taylor walked down the corridor right now, I'd get to him if I had to jump through that playlist window. Well, you can jump at him if you want to. I'll wait here and catch him when he throws you back. It'd be funny. Operator, operator. Oh, I'm sorry, but Robert Taylor doesn't answer. He must be on his way over. I just called his house and he doesn't answer. In the meantime, uh, Phil, maybe we ought to... Oh, that must be Bob now. Come in. Okay, where is he? Where is he? Well, wait a minute, mister. I don't know who you're looking for, but you must have the wrong place. No, I ain't. I'm looking for a guy named Benny. Look, Bob, we're doing a show here. Now, what do you want with Benny? I married him yesterday on Bride and Girlie. William don't promise me. He promised me ten bucks. You're at twenty holding that wrinkled old hand. He left right after the ceremony. Well, how do you like that? He goes on a honeymoon and leaves me here with my wife and kids. Oh, now, don't worry about it. Don't worry about it, fellow. When Mr. Benny comes back, I'm sure he'll give you the ten dollars. And fifty cents. He made me pay for the rice. Oh. Knocks on the door. I was a widow's peak. See you. I'm lucky to be here. As I came down the hall, something jumped at me through a plate glass window. A plate glass window? Oh, my goodness, Bob.  That isn't blood. That's lipstick. It kissed me. Well, anyway, Bob, it's certainly nice of you to come over and fill in for Jack. Glad to do it, Mary. I think you know everyone. This is Don Wilson. Oh, sure. Sure. How are you, Don? That's the control booth. Don's over here. And, Bob, I'm sure you know Phil Harris. Yes. As a matter of fact, a couple of months ago, I took his place with Alice. Wait a minute, Raul. He takes my place with Alice. That doesn't really mean that. I just meant that when you were in Denver, I took your place on the Fitch bandwagon. I know, but you wouldn't have been there if Alice hadn't have tricked me. Tricked you? Yeah. She told me she was hiring Spangler Arlington Brew. With a name like that, I thought it must be a ballet dancer. Well, that's funny. I've seen you lead an orc, sir, and I thought you were Gilda Gray. Don't argue. Jack won't like it. Oh, hello, Don. Hiya, Phil. Hello, Mary. Hello, Dennis. Mr. Benny, those must be wonderful vitamin pills you're taking. That isn't, Mr. Benny. It's Robert Taylor. Robert Taylor? Yes, I'm a ballet dancer. But, Taylor, the movie star.  She even keeps your picture under the icebox. Under the icebox? She doesn't want my father to know she's got your picture. Oh. The other day, my father came into the kitchen and, oh, boy, did my mother think fast. She did, huh? Yeah, when my father said, what are you doing with your head under the icebox? Let him alone. Let him alone. Hey, tell me something, Spang. I don't blame you for changing your name, but how'd you happen to pick Robert Taylor? Well, it was by accident when the studio told me that I needed a stage name. I thought of a lot of them. Didn't know which one to take, so I picked one out of a hat. Gee, that's a coincidence. When I was born, my mother picked my middle name out of a hat. Really, Dennis? What is your middle name? Sweatbin. Bob, at this point in the program, Jack usually has us do a commercial. Go ahead and read it. Oh, no, I just don't read it. You see, we do a musical commercial with Jack's Quartet, the sportsman. Oh, hello, fellas. Ah, they have a wonderful selection prepared for today. You were meant for me. You were meant for me. Say, Don. Yes, Bob? Do you think they'd mind if I accompanied them? I do play a musical instrument, you know. Well, Bob, I didn't know that. What instrument do you play? The cello. Oh, no. It's not a cello. You don't play any instrument. Bob, if you want to accompany the quartet, go ahead and do it. Okay, just wait a minute while I get my cello. Okay, Bob, while you get set, I'll announce the number. Ladies and gentlemen, you were meant for me by the sportsman's quartet and starring Robert Taylor on the cello. You were all the good things rolled up in one. You should try our lucky. They are better than the rest. The quality of your product is essential to success. Little time for music. I used to play a musical instrument. You did, Dennis? Yeah, but one day my mother got mad at my father and threw it at him and it got smashed against the wall. Aw, that's too bad. What instrument was it? The piano. That's terrible, Dennis. Did anybody get hurt? Just me. I was still sitting on the stool. It's Robert Taylor. New York calling. Say, Murray, it must be Jack. I know this is long distance, but how much does it cost to say how are you? What did you call for? Not enough laughs on the program. See, I can't understand that. I'm really working hard. I've even got my coat off. My pants. Want to talk to Mary? Just a minute. Mary wants to talk to you. Oh, thanks, Bob. Hello, Jack. Sound like Gessel. I want you to sing your song right now. Okay, Toots. Toots.  Okay, Dennis, go ahead and sing. Shadows on the trail from Walt Disney's picture melody time, featuring Dennis Day. And very good, Dennis. Dennis, who? Dennis Sweatband. My name is Nelson. I'm a photographer and I was asked to come over here and take some pictures. They'll appear in the five magazines I work for. Five magazines? What are they? A peak pic, click, look, and snub. Well, Mr. Nelson, if you're going to take pictures, you better get started. Very well. I'll set up my equipment.  No, it's my dark room. I've got two midgets working in there. Yes, they're half Nelson. Aren't you glad you have? And now for the pictures, I'll take Curly first. Are you ready? Anytime you are. How do you want me? Profile or full?  Then you shouldn't talk that way. Let him alone, let him alone. I'm the star of the show today, so why don't you take a picture of him? Very well. Will you sit here in this chair and hold your cello between your knees? Certainly. Like this? Like this? That doesn't look too good. Lean the cello on your right knee. Now, I'm trying to get something that shows you're a great athlete, but I can't seem to get it with a cello. Well, if you want something sporty, I can slide it under me and ride it side-side. I'll think of something. Well, in the meantime, how about taking a picture of me? I'm sorry, but I don't take landscapes. You look like a good subject. Me? Yes. Did you ever have your picture taken? Only once when I was three weeks old. That was when you were a little baby.  She didn't have to. Each year, she had the picture enlarged. In my last picture, I'm nine feet tall with a diaper on. Mary, does Jack go through this every week with Dennis? Why do you think he went away for a rest? Now, what about the picture? I'll do it right now. Come here, young man. Now you stand right over here. Yes, now hold it. Silly, you made me hold the camera and I took your picture. Oh, my goodness, I did it again. I've got three million pictures of myself. What's the pictures all over with? Mr. Bentley Shaw was considerate. He was? Yeah, Mr. Bentley came over and said, Rochester, you don't look so good. And when I told him I didn't feel good, he said, well, you better hurry up and dust the house, wash the dishes, cut the lawn, trim the head, sweep the porch, clean the chimney, polish the silver, wash the woodwork, wash the floors and get right to bed. Finish washing the woodwork. Well, Rochester, now that Mr. Benny is out of town, I think you ought to take the opportunity to get out of the house and get some fresh air. Get out of the house? What are you laughing at? This chain is so short I can't even bring the milk in. What's making up jokes? Well, I've called you if I had straight lines. I thought so. Well, what did you call for? I'd like to talk to Mr. Taylor. Oh, just a minute. I'll call him. Oh, Bob, Rochester wants to talk to you. Okay. Hello, Rochester. What is it? Oh, Mr. Taylor, since you're going to be eating here for the next few days, what time would you like to have your dinner? Well, would seven o'clock be all right? Yeah, that'll be okay. And Rochester, I'd like to have steak, potatoes and peas. I'm sorry, Mr. Taylor. I read the contract Mr. Benny gave you and steak ain't on it. Well, then what do I get to eat? Potatoes and peas. Just potatoes and peas? I've got the contract right here. I'll look up the clause. It says peas. Clause 51280. That's the number of the clause? No, that's the number of peas. Well, Rochester, what do I get for dessert? What? Dessert. Yeah, that's something extra that's added to top off your dinner. Well, when did they start that? A couple of weeks ago. Well, anyway, Rochester, as long as it's only for a few days, just give me what's in the contract. Okay. And Mr. Taylor, what time do you think you want to go to bed? I'll sit up and listen to the radio for a while. Good, good. That'll give me plenty of time to lay out your pajamas and ballet slippers. Thank you, Rochester. I'll see you in a little while. Goodbye. Planned so many things I wanted to do on this program but that photographer came in and took up all our time. Well, Bob, I've got a confession to make. I sent for him. You sent for him, but Mary, you almost spoiled the program. Well, who cares? Now I've got pictures of me working with you so I can send him back to the girls at the May Company. Mary, you used to work at the May Company? Well, what a coincidence. Did you used to work there, too? No, but that's where I buy my ballet slippers. Oh, playfield. I'm going to be first here is Basil Riesdale. Lucky Strike, first again with Tobacco Man. At the first, I'm not a... First again with Tobacco Man, Lucky Strike. As a recent impartial survey reveals, more independent tobacco experts smoke Lucky Strike regularly than the next two leading brands combined. Lucky Strike, first again with Tobacco Man. Remember, these are the experts, the man who really know tobacco. And more independent tobacco experts smoke Lucky Strike regularly than the next two leading brands combined. You've heard the survey results. Now listen to what Mr. George Alfred Webster, veteran tobacco warehouseman, recently said. At market after market, I've seen the makers of Lucky Strike by fine, light, mild tobacco. Tobacco that makes a grand smoke. I've smoked Lucky Strike. So light up a lucky. Light up a really fine cigarette and puff by puff, you'll see. LSMFT, LSMFT. Lucky Strike means fine tobacco. And in a cigarette, it's the tobacco that counts. So for your own real, deep down smoking enjoyment every time, smoke the smoke tobacco expert smoke. Lucky Strike, so round, so firm, so fully packed, so free and easy on the draw. Lucky Strike, first again with Tobacco Man. Lucky Strike, first again with Tobacco Man. Lucky Strike, first again with Tobacco Man. Lucky Strike, first again with Tobacco Man. Lucky Strike, first again with Tobacco Man. Lucky Strike, first again with Tobacco Man. Say it, Mary, I was just looking at this magazine Radio Best and Jack was picked as the number one comedian. Well, how do you like that? What are you laughing at, Mary? Jack's off the air one weekend already. He's America's favorite comedian. Good night, doll. This is NBC, the national broadcasting company.


Hello, everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So today we are going to discuss few more topics related to Lightning Web Component. And today is day 81 of this bootcamp and part 4 of Lightning Web Component. So so far I discussed lots of concepts related to Lightning Web Component. So let's cover few more topics related to Lightning Web Component in this session. Okay, so moving forward, so if you have joined this session or you have, you are for the first time on this channel, so you should know about me. So for that, you can go through with this slide and on this slide everything, whatever I have done professionally and whatever I am doing is available. So you can go through with this slide. So always remember consistency is the key. So please do regular practice. And if you want to become part of the community where lots of Salesforce, Beginner or Salesforce enthusiasts are connected, so you can scan this QR code and here you will find lots of people helping each other. So we are in week 24 of this bootcamp. So we are learning Lightning Web Component. This is week two. And I think next week also we will be having few more sessions on Lightning Web Component. And after that, few more sessions will be there which are related to deployment and how QA actually works. So those sessions will be there for the benefit of you. So do follow Sanjay Gupta Tech School on YouTube, LinkedIn, Instagram and Telegram. And all the important links are available in the video's description. And please share a review and review your feedback about the bootcamp. And like from tomorrow, we are going to start one more bootcamp that is related to Appian. So tomorrow, same time, we'll be having an overview session related to that. So you can join that if you want to learn a new tool. And now jumping onto the topic. So in today's session, I will be covering three topics. So if I take you to the session tracker, so all those topics are mentioned here. So we will be talking about how we use CSS and Lightning Web Component. And I will let you know, like if you have created your Lightning Web Component, so it comes with a default JavaScript file. But apart from that, if you want to have more JavaScript files in your component, so how you can use that within the component and outside the component. And other than that, we have life cycle hooks. So I will be explaining their life cycle and whatever methods of those are related to life cycle hooks, we'll be discussing them in detail. So let's first discuss about CSS style sheet. So basically, if we talk about a Lightning Web Component, so in a Lightning Web Component, there are four major files. One is HTML file, second one is JavaScript file, third is .xml file and fourth is .css file. So remember, whenever you create any Lightning Web Component, so that CSS file is not available automatically. So this I told you in previous session as well. So whenever you want to write some CSS for your component, so you need to additionally create that CSS file, right? So here you can see in this example, it is very simple. And here we have parent.html and parent.css. So two files related code are available. In parent.html, we have H1 tag where to do list, this text is available. And in .css file, we have the CSS code. So if you have gone through the CSS related video, so I think you will be able to understand this code properly. If you have not gone through the prerequisite, which is HTML, CSS and JavaScript, so I would request, please go through all those sessions so that you can understand it very well. So here we have the CSS, which is for H1 element. And here we have this attribute font size and we are assigning x, x large as font size. So automatically, this CSS will apply to this H1 element that we are using in the HTML file, right? So this way, simply like whatever CSS we implement for web development. So the same style you can write here in the additional .css file. Okay, so I hope you are able to understand this example. So simply you can create this component, you can deploy it to org and you can place it on homepage and you can test it out. Now, moving forward, we have one more example. So in this example, we have two components. So if you see above, we have parent.html and parent.css. And at the bottom, we have child.html where also we have H1 element implemented. And this child component we are using in the parent component here, like c hyphen child and then we are closing it here. Okay, so this way, if you want to use any child component into parent component, so you can write it like this way. Now, we need to see whether this H1 CSS that is defined in the parent.css will apply to the child component HTML, sorry, H1 element or not. So the answer will be it won't be applied. So whatever CSS you have implemented in the parent.css file, so that will apply on to the parent.html H1 element. It won't be applied to the child components H1 element. So for that, there are two ways. First, you can write CSS in the child component itself. Second, you need to write CSS in the parent component that will apply on the child component, right? So how we can do that. So like anytime if you see any doubt, you can ask in the chat so that I can answer your questions, right? So don't hesitate. And if you if you have any sort of question that you want to clarify, you can ask because these are the advantages of joining the sessions live. So if I move forward, so you will see example number three, an example number three will show you how in the parent.css, we can have the CSS for child component. So you can write c-child. So the CSS display and border, the both CSS will be applied to the whole child component, right? So this way, if you want to apply CSS on the whole child component, you can write it like this. Otherwise, what you can do in your child component, you can create a .css file. And there you can write colon host and the CSS. So whenever this child component will be hosted by any other component, so this CSS will be applied automatically. And other than this, if you want to apply normal CSS for particular element, so you can write it in the same way, we implemented CSS in the parent.css file, right? So these are different ways to write CSS if you have one component or if you have more than one components in a hierarchy, right? So I hope you are able to understand. Now we have one more thing, how to share CSS style rules. So it is also possible like if you want to create a specific component, that component will be having only CSS file, and you want to import that CSS file, similar to external CSS. So here you can see we are creating a component named as CSS library. Now you need to remember this component can have only two files. So normally what happens when we create a component .html and .javascript file also created automatically. So if you are creating a CSS library, so you need to delete those .html and .js file. And you will be having only .css and .js meta.xml files. In that library, right? That will be a component. And here you can see CSS library.css. In this file, we have some CSS defined. Now how you can use this in the component. So let's say we have created one more component whose name is my component. Here we have .html.js. .xml and .css. Now in this component CSS, how you will be importing that CSS. So you need to write at the rate import. And in single quotes, you can write C slash CSS library. So CSS library is having only CSS file. So automatically that will be imported. And whatever CSS you have implemented there, that will be applied automatically onto this HTML file, whatever elements you are using. Yeah, yes, Vanessa, the use of host is like whenever you use any component into another component, so that host CSS will be applied to the whole component, not to the particular element. Okay, so if I take you back, so here you can see we have this colon host. So display and background, this whole CSS will be applying on the component, whole component will be having this. If you have specific CSS that will be applied to particular element only. Okay, so this way I hope you understood how we can create a independent component having only .css file and how we can import it into another component. So this is important to know if you're working as a LWC developer like we can import any CSS library into any other component. Okay, so this this was about CSS. Now let's talk about JavaScript. So similar to CSS, like we shared CSS file from one component to another. So similarly, you can share JavaScript code as well. Right. And this is also important to understand. So whatever today we are discussing all these are concept related things. And whenever you have time, so you can implement these concepts in your existing component that you have implemented for the practice purpose. So here you can see we have a component my component and in this component, we have total five files, right? If you see this component, so we have total five files. So we have my component.html.js.xml. So these are common. These three files will be available with all the components. But if you see at the bottom, we have two more files, my function.js and utils.js, right? These two files are also available. And these are also JavaScript files. So these are additional JavaScript files. So always remember whenever you have a component and you see more than one JavaScript file. So the JavaScript file whose name is similar to the component that is the main JavaScript file, right? And others are supporting JavaScript files. Okay, so in these JavaScript files, whatever functions you are defining, you can import that function in the same component, as well as into any other component. Okay, so now I'm going to show you how we can do that. So if I move forward. So here you can see how we can share JavaScript within component. Okay, so in previous example, here we have a component my component. And in this my component.js, I will be using my function.js and utils.js. So how you can use it this way import then inside curly braces, you're using get amount calculate cost from dot slash utils. So why we are using dot here because this utils dot JavaScript file is part of that component where your primary JavaScript file is available. If you're supporting JavaScript file is available in the same component. So in that case, you will be using dot slash and that particular JavaScript file name. And similarly, you can see in the second line also we are using same process. But the difference is in this first import statement, we are using curly braces. In seconds import statement, we are not using curly braces, right? Now, what is the difference between these? So for to understand these points and to understand few more things, you just need to focus on the below points which are available in form of notes. Okay, so just just go through each point one by one. So first says a JavaScript file can export named exports or a default export. So there are two types of export. So whenever we create any additional JavaScript file. So in that JavaScript file, we can have two types of exports, right? It can be having a name or it can be a default export, right? So if it is a named export, so the code uses the specific name in curly braces. It means get amount and calculate cost. These are named exports, which are defined in utils.js. And to import a default export, the code can use any name. So this this my function is having default export. And here you can use any name. So in the example utils.js uses named exports and my function.js uses a default export. So I hope with this explanation, you are able to relate it. Now, going forward in the upcoming slides, there will be more examples with which you will be able to clearly understand how we can define name exports and how we can define default exports, right? And this is very much important if you want to become export and lightning web component. So all these things which we are discussing in today's session are very much important. Okay, so here, we are having two components. So after this slide, we'll come back on named exports and default exports as well. But before that, focus on this one. So we have first component as more more gaze utils. Here we have .js file and .xml file. Then we have my component where we have HTML JavaScript and XML file. So the folder and one JavaScript file must have the same name. In this example, the name is more gaze utils, right? So moving forward. So here you can see, here we are importing files. Here we are importing any other JavaScript. So what is happening? We have two different components. So if you want to import any JavaScript file, that is not part of the component, or it is part of any other component. So this is the way you can import it. So you need to write C slash mode gaze utils. So here we are using C slash. If I take you back. So earlier what we did we used dot. In this case, these additional JavaScript files was part of this component only. So if your JavaScript file is part of the same component, you need to use dot. If it is part of any other component, and you are importing it into any other component, so you will be writing C slash. Okay. And in the import statement, specify the folder to import from not the file, don't specify a file extension. So basically, this C is the namespace where all the components are available. So we need to use it. Then other components can import code only from the library's main JavaScript file, which has the same name as the folder, right? And the components cannot import from a supplement JavaScript file with another name or a file in a nested folder. So to share such code to say sorry to share code from such files, export their functional variables, then export them again from the main JavaScript file. So basically, what is the meaning of overall overall meaning of all these statements like if you want to import any JavaScript file from any other component, so it should be the primary JavaScript file. And if you want to export any additional JavaScript file, so that function you need to use here in the primary file, and through primary, you can call them here like this, right? So within the component, you can import any file, any JavaScript file, but from any other component, you can import the primary JavaScript file. Okay, so I hope this way you are able to understand the concepts. Now here, we need to discuss how we can write export default function. So earlier, if you remember, we discussed about named export and default export. So if you have my function or JavaScript file, and in this file, you want to define only one function that is default. So this way you can write export default function. So this function is not having any name, right? So this way you can define default export, and you can write any code, whatever code is written here that will be executed whenever you will be importing. And here you can see this way we are importing it, we don't need to write any curly braces, any name we can use here, right? So to refer to the default export, the component that imports the function must choose a name in the import statement. It doesn't have to be the name of the exported function or JavaScript file. That's just a convention. So right now we are using my function, but it can be any name we can use. Okay, so moving forward, now we need to understand how we can export named function variables. So here is the example. So here we have this file, mode gaze, utils.javascript, right? So here this one is the named function. So this is basically a variable and below we have a function. So get term options. Here we have this collection, label, and value, label and value. So this block will be returned and below we have calculate monthly payment. So it will be receiving three parameters and we need to write the logic here. And here at the bottom you can see we are writing export these two get term options and calculate monthly payment. Okay, so this way you can define named export for functions as well as variables. And this way you can import it into any other component, right? So we are writing import, get term options, calculate monthly payment. So now these names should be same as you defined in the component, JavaScript file and from C slash mode gaze, right? So okay, so this, this, this was by mistake. Now next topic is life cycle hooks. So till now whatever we discussed, we discussed about CSS how we can use it. We discussed about additional JavaScript files that we can create and share, right? So next is life cycle hooks. This is also an important topic that you need to know. So before starting this, I just want to recall in aura, we used to use init method. In aura component, we implemented init method, which which were executed whenever a component is loaded, right? So whenever component is loaded that init is automatically executed. So it was like event that we need to handle. So similar to that, if you want to do any operation automatically whenever your component is loaded onto the browser. So we have different options here, different methods here. Those are known as life cycle hooks. So lightning back components provide methods that allow you to hook your code up to critical events in the components life cycle. So these events include when a component is created. So whenever component is created, so constructor will be executed. Whenever component is added to the DOM, DOM means document object model. So whole HTML page is basically known as a document. And whenever any component is added to the document, so it means you can say your component is added to the DOM. So your component will be added added as a object in that document. So that's why it is known as document object model. So whenever your component is added to the DOM, so connected callback method will be executed. Then whenever your component is rendered in the browser completely, then rendered callback is executed. If there are any error, once your component is loading, so error callback will be executed. And if you are removing your component from the DOM, so this connected callback will be executed automatically, right? So these are some life cycle hooks that you need to know their meanings. And in interviews also like this question is asked frequently. So now we are going to discuss them one by one. So before that, you need to understand the life cycle of this life cycle flow of this life cycle hooks. So basically, first of all, what happens, constructor will be called on the parent. So here in this flow, I am assuming we have two components. One is parent and one is child. And I hope everybody knows like child component is called, which is which is used in any other component, which is called in any other component. So that component will be treated as parent. So generally, a parent will be loaded first because child is part of that parent component. So that's why here it is written constructor called on parent. Okay, then public property value of parent is updated, then parent inserted into the DOM, then connected callback called on parent, right? Then parent rendered on the browser. And after that, constructor called on child, public property value of child updated, then child inserted into the DOM, then connected callback called on child, then child rendered, then child rendered callback called on child, right? So once child is completely rendered, then only we can say like parent is also rendered completely, right? So, yeah, so basically, with this life cycle flow, I hope you are able to understand the sequence how these different methods are executed. Okay, so moving forward, next is constructor. So how we can write constructor? So it will be written in your JavaScript file.  Super means the class which we are inheriting. So if that is having any constructor, so that class constructor will be executed. Otherwise, the constructor is having this statement. This dot test equals to component instances created. So what is happening here, we have created a property. So here, we have created a property and this property we are assigning component instances created. So we are using this, I hope everybody know now, like why I have used this here, because whenever we create any property in JavaScript and you use that property after its declaration. So every time you need to write this dot with that property. Okay, so Pooja, the exact meaning of parent rendered means parent is rendered completely on the browser, like you are able to view whatever code you have implemented in parent component. So the result is available on the UI. Right? So whatever code you have written, it is executed and it is visible to the UI. So it means your component is rendered. Okay, so this is the constructor thing. Now we have connected callback. So it is simple example. Here you can see we have a HTML file. So in this HTML file, we have a dev where ID is waiting and if false, ready. So if ready is true, then it will become false. If it is false, it will become true. Right? And here we have if true. So ready is a property which can be having true or false depending on the JavaScript file. Then these are two more properties name and price. Okay, so if ready is having false, then this loading will display. If ready is having true, then this loading will disappear and this name and price will disappear. This way it will be working and it is connected callback demo. So here you can see in the JavaScript file. Here we have name and price. Then we have ready. Initially it is false. Initially it will it is false. So on UI you will see loading and after three seconds ready will be converted into true. So inside connected callback we have used set timeout. So in this set timeout we are setting this dot ready as true and its timeout value is 3000 millisecond. So 1000 millisecond is one second. So after three seconds your this code name and price will be rendered on the UI. Okay, then we have rendered callback. So once your rendering is done like whatever code you have implemented in your component, if it is rendered on the UI and after that if you want to show some message. So at the bottom you can see we have if true and rendered and component come successfully rendered. So this message is available. So what you can do in JavaScript, you can implement rendered callback similar to this connected callback and what you can do you can create a property. Property name will be rendered and its value you need to set as true. Then only this component successfully rendered message will be displayed on the UI. Okay, so first this connected callback will execute and once your whole component is rendered all the output is displayed on the UI then only this rendered callback will be executed. And this this is the error callback. So whenever there will be any error at the time of loading of your component so it will be executed. So it is very unique to LWC. So implement it to create an error boundary component that captures errors in all the descendant components in its tree and it captures errors that occurs in the descendants lifecycle hooks or during an event handler declared in an HTML template. So you can code the error boundary component to log stack information and render an alternative view to tell users what happened and what to do next. So how we can do this so this way you can implement your error callback component. So basically if there is any error so you can have one more component. So error view is an additional component that you need to define. And in that component we can pass these two parameters like error and info. So in error we are passing error and in info we are passing the stack. Stack will be having all the error related messages. So you need to define this error view component and in that components HTML you will be rendering error and stack information. And if there is no error so you can have any other component and that that can be called right. And this way you can implement the JavaScript. So here you need to define two properties error and stack and if error is there so error callback will be executed automatically and basis on that like you can define the values. Okay. So Vishal is asking what is connected callback. So I'm going to explain it again. So basically Vishal you need to understand this. So whenever your component is added to the DOM so then your connected callback is executed. Right. So you can imagine like whenever your component is rendering on the UI and before rendering is completed. So before that like before your rendering is completed your component is added to the DOM document object model. So at that time your connected callback will be executed. Right. So you can imagine like whenever your component is rendering on the UI. So first constructor will execute then automatically connected callback will execute. And once your component is rendered successfully so rendered callback will be executed automatically. And these these methods are executed automatically. You don't need to do anything. You just need to define them in the JavaScript file. So if you define it this way so it will be executed automatically. Now it's up to you what type of code you will be writing in these life cycle hooks. Okay. So this is it for today. So these these are some important concepts. Okay. So Manjunath is asking can explain rendered callback with any use case for example. So basically sometimes what happens whenever your component is loaded and on load of that component if you want to notify any other component. Right. So that kind of operation you can do with the help of rendered callback. So on completed on completely whenever your component is completely rendered on the UI and basis on that if you want to perform any kind of operation. Right. Whether to notify any other component or to pass the value of that component into any other component or to show some UI some pop up any message. So that kind of thing you can do with the help of rendered callback. So right now I don't have any use case for disconnected callback because I also like never used this this disconnected callback in any of the scenario because it is it is very rare situation when we'll be using it. So but I will figure it out and if I find some solution. So in next session I will be explaining about it. So Mukhiya, so we cannot use it directly because that is the part of syntax. So Sri Lakshmi is asking want to add new button to list view of the application. So in list view I don't think we can add any component. So for list view I think you need to create a button and then I just need to check this question because I'm not sure whether on list view button we can add component. So I will be checking this. I'm sure like on quick action we can launch the component but on list view button I'm not sure we can. Okay so there is asking can you please explain life cycle hooks with real time example. So real time example is like if you are rendering any component and like as I took an example in my example as well. So here you can see in connected callback we have this set timeout and like initially if you want to show some spinner whenever your component is loading and if you want to show some spinner or loading kind of thing. So if you want to like delay for some seconds so you can do that with the help of connected callback. Right so with that connected callback what will happen this this this code will be running whatever code you will be writing here and the below code won't be executed whenever that time limit will reach so above will disappear and below will be available on the UI. So this way you can manage your loading and similarly once your component is completely loaded completely rendered on the UI and after that if you want to show some message you want to do any kind of operation so in that case you can use this rendered callback. Right so it depends on the requirement whenever you will be having real time requirement and if you see this kind of scenario like before showing the results if you want to do something or after completion of rendering if you want to do something so you can use these connected callback and rendered callback and one more example is like in Aura also we used if you want to fetch some data from Apex so those code also you can use in connected callback right so you can fetch that data and that will be available on the UI with the help of HTML so you don't need to call any method explicitly for that so these kind of automated process you can do with the help of these life cycle hooks method so Ashutosh is asking one more time to export explain how to export supplement JavaScript file so there are two scenarios if you have supplement JavaScript file in the same component if you have supplement JavaScript file in the same component so you will be using it like this you need to write import and then dot slash and then the JavaScript file name and if it is part of any other component like if you have two separate components and from one component you want to export JavaScript file into another component so you will be writing this C slash and then JavaScript file name so Ramya this healthy view and error view are the components in error component these are a child component that you need to define separately so from error component we are passing this data and in error view it will be receiving error and stack and healthy view is another component that you need to define so we are assuming like if there is any error so this is for testing purpose like if there is any error so it will be assigned if there is no error so this will be executed thank you Tejas for appreciating the first so Vishal I think with this life cycle you will be able to explain so just remember this life cycle flow and you will be able to explain and the meanings are available here yes vresh if you are applying for developer roles so back end development and front end development both are important no vresh we cannot use JavaScript for back end development for that we have apex and JavaScript is basically client side scripting language so whenever you have anything that you are implementing on front end so generally there we use JavaScript okay so this is it for today's session if you have any question you can ask I tried to answer all the questions so like next lightning web component session will happen next week because tomorrow same time we'll be having apion overview session so lots of folks are asking what is apion why to learn apion so Ankit will be explaining everything related to that in tomorrow session right so if you want to know you can join live otherwise you can watch the recording as well and later you can decide whether to learn that tool so if you are working professional and in your organization apion tool is used so that will be useful for you and if you are a beginner and you want to learn any local development tool other than Salesforce so apion is another option for you so Ankit Java and apex are different you can say if you know Java then easily you can understand apex but they are kind of different so Mukhiya Vedya Vedikran so you can track minor updates so Salesforce provides their release document so whenever there is a release so you can just go through that release document and there you will find whatever latest updates are available so if I show you those so here you can search so recent Salesforce release notes so recently summer 23 release notes are available so if you open it so you will be able to find whatever minor changes are done so this document will help you to know in which product what is what has changed right so here everything is available and for development if you expand this so here you can see we have lightning component visual force apex API packaging development environments platform development tool etc so everything is available if you expand lightning component so these are the changes which are done in recent release so this way you can go through this release notes and you will be able to understand what has changed so I hope this will help so Samyata so I will be sharing one document where a few exercises and project will be available so you can practice that at your own so Sri Lakshmi this this is a simple use case and if you do some Google so you will easily find that code so you can just have that code and paste it in your component yes we wish you can switch but you need to know backend development as well okay so I hope I answered every question and see you tomorrow with the new bootcamp overview session yeah I will be sharing admin sorry LWC project but it will be extension of that project which we did so admin and development we already did backend development for front end development I will give you some exercises okay thank you everyone see you tomorrow with the new bootcamp overview session thank you see ya bye


So last time working with the alpha smart Dana I got a debug tool up and running that talked directly to the system on a chip and Was able to do various things download code upload code, etc Since then I have actually gone away and fixed the programs. It actually works, which it didn't then this Chip seems to be quite buggy and the bootstrap mode stuff doesn't work Quite as well as I thought such as for example of the 32 byte instruction buffer that you use to put instructions into Get overwritten on every right that the system executes. So that's not ideal But that should now be working and so today I'm going to start work on the main port of the operating system that I want to run on this thing, which is emu toss No, it's not physics Just for a change This is an open source rewrite of the old Atari toss operating system from the Atari ST which is a quite nice and simple DOS like operating system with an integrated GUI, which you can see in the screenshot here It should run quite nicely on this machine. The only issue is the screen is quite Short, it's only a hundred and sixty pixels and emu toss really wants 200 So we may end up with some dialogue boxes being chopped off But I'm nowhere near the GUI stage yet. Like I haven't even started any work or Really looked at it much So what I'm going to do today is to try and at least get a emu toss image built For the device not necessarily make it run, but it would be nice So I Know this is portable. I've checked up ahead of time It runs on a variety of different pieces of hardware including the Amiga So if it can run on the Amiga, it can probably run on this thing So I need to first Set up the build so I might as well go and copy the Amiga set up Let's just go Dana What is ROM Amiga That's the name of the ROM that's being generated. I'm not actually going to make a ROM I'm going to Produce a RAM image Which I will then attempt to upload onto the device and execute Okay So now we go look for The Amiga image section and we will copy this It should be nothing particularly exciting about the build So every reference of Amiga needs to become Dana No idea what that is. So I'll leave it right. I don't know what look wrong does. It's just it's an executable Which I presume Does the work? Okay, this actually converts stuff into ROM images. So we'll need to update that as well So Do we have No references to Okay so we should now be able to say from Dana and That did not work at all. All right, it built but Then mukram crashes. So let's just clean that and do another build and See what it does That does seem to be building rather more than I was expecting Okay, we're gonna have to work on mukram now So this is the list of ROMs, which we can generate so we simply add Dana to the end of it Duplicate this We don't need to check some actually actually We don't need this at all We're going to generate a generic ROM the command pad version which will just add zero bytes on the end based on The size given. I wonder if we can ignore the zero bytes a suspect We might not anyway, let's Let's go back to the make file. Let's try changing command pad Zero. Is that gonna do anything? Yeah Okay, let's have another look at mukram. I wonder if there's a way to get around Padding The mega ROM image is checked some well all the Amiga stuff is checked some that we don't really care about What's a pack three? Also has padding Okay, let's just add a oh wait a minute. Wait a minute.  Okay, so we now have emutas daner rom which is a Hulking great piece of code It's a whole 280k Which is more than I would like to download over a 19.2 kiloboard serial link Even if I have got the got it working actually at 19.2 kiloboard So we are going to try to chop some stuff off this Now we yeah, here we go so The first thing we're gonna do is to Turn off the AES which is the GUI system. So that should be doable like that does Interesting I get that right. I think I did not get that right Well, here is the code for cart. So that should be interesting, okay Can we set it manually and make something happen something did happen then so intriguing Okay, let's just do that on the command line then zero and Right that fails because So dos you see those don't look like graphical things. They look like DOS based things. So why is it? Why would it be? Why would they be missing I would think with a name like that they would be in there which they're not This DSP stuff looks like It's Hardware specific that I do not want for this case. Yes, look It's obviously referring to some hardware device Okay, so that's being enabled from somewhere We have to turn that off. Yeah, I was never actually expecting Any of this stuff to work out of the box here we go Target defaults Really these should fail it should just fail to build in a sensible fashion if These are not set Okay So by the looks of it we need two of these to find one for the ROM So this is target Dana ROM and one for the machine machine Dana So if machine Dana, then it's not Atari hardware We do not have IDE. We do not have UAE Okay, that's better and it's we're now down to 100k which is better It looks like this is still trying to build all the VDI stuff This is the the graphical interface So let's try and get rid of that the obvious thing to look for is a use VDI which there isn't okay, so Where's VDI source used by Apparently nowhere. So one possible one possibility is that the Configuration I'm interested in is actually in the source code itself But it does not appear to be I Think that these variable names are Referred to Dynamically, so let's look for yeah, here we are right, so This is where it decides to Enable various options, so we want a if with VDI one optional dears is VDI and if and Okay, so now If I build that again, but we're with VDI for zero then Lots of things fail because this is not designed to have the VDI removed. Why is that in the BIOS? That looks like a graphics thing Line a graphics stuff. It is a graphics thing. That's a shame. I think we may have to keep the VDI So let's just take this stuff out again Which makes the whole image rather bigger than I was wanting at a hundred K a Problem is I get about 2k a second download speed so that takes 50 seconds just to load the image into the Onto the device I If I can press it then Yeah So if I can transfer it compressed then that reduces it to about 30 seconds, which is still annoying large amount of time, but Anyway, we have a built an image that is building so Where is that config so Let's go looking for a me go hardware in the startup code. How about BIOS startup that looks like a useful thing So this is the this is the ROM header Which has to be a specific size for the Amiga? We don't care about that So in fact our ROM will start with Should be able to debug it as a matter of fact Well disassemble it Image I have to tell obj dump that I want it. I want to disassemble a binary file Which is Option to specify the architecture here we go Try be binary. I'll support the 68,000. I know that you need to get the name, right? M68k M68k heaven's sake and of course none of these are the actual elf image Okay, both these things are the same File, let me just try and find where it puts the object File from it. Let's get emu to stop image Comes from All the objects as interesting that should actually be Okay, it's somehow figured out a way to generate a binary directly with LD, which is no help for us I do want to try and get the dissembler working so I'll actually Do a bit of offline research for that one Yeah, all I needed was the option to tell it to disassemble everything rather than The only the things it thinks is text Of course, it has no information about the binary so it thinks it's all data Therefore it didn't try to disassemble anything so back to startup.s So at the top of our image be branched to main which is here main is To dress 30 we should find it here Real main is a bit further on Possibly in different object file. Nope. It's here Which is that for e But of course it's decided not to disassemble for e because of multi word instructions so by the first instruction that actually synchronizes with the disassembly We're not getting any of that. So These three instructions Here this one lea. Yeah, this sets the stack so firstly We are probably going to need to Run some of to do our own setup code somewhere in here But we can get away without that for the time being The environment where I download images into it will do all the setup for us There's a nasty script that does it and pokes the registers directly So we don't need to put that into the code for the time being but we are going to need to Set the memory map. So where is That top to find Probably here. Yeah, okay target Dana We are going to load the ROM at There this is immediately after the vector table in the beginning of RAM. I wonder do should we set this? In toss lives in RAM, I think that with this set it will generate a Relocatable object file rather than an absolute object file, which I don't think we want So let's leave that We rather want to put the No, let's do it the way They want and let's see what this does when we build it It's gone somewhere Yep, uh, I don't want Dana ROM. I want Just want target Dana. Okay, that is now different Yeah, so st RAM is the RAM area up on all 68,000 Well, all 68,000s have to have the vector table starting at zero So you either need ROM or RAM at address zero and on the st It's RAM Likewise on this system. We can easily configure it for RAM. So And it's decided to put things Whereas it decided to put things two ones 2140 That's after the variables Oh, yeah 68000 system variables like being below 64k because there's a short addressing mode that allows you to get at them from anywhere Yeah, it's like the six four zero two zero page So that actually seems quite plausible so For okay only start address as matter we have 16 megs Okay, extensive files up to the end of supervisor only ram All right. So what does our image look like now? That looks like it's uh The same branch instruction So I think we have an image that's good to load at the that the target address and then it should work So let's just trace through from real main, which is a 4e Okay, we set sr ignored ignored ignored Load the stack Which is Here is that the right place for the stack? Yep We get stack from 800 to 4k 2k to 4k So there we set up the stack We're not a cold fire or a lisa Reset the external hardware. We might need this So the reset instruction sends a command to all the external hardware to reset it basically I think we can get away without it because our system has just booted and therefore I mean we've just come out of the bootloader. So there nothing has been set up to be reset So where were we reload the stack? We Initialize some things. I think we're here actually Reset the vbr Which I'm not quite sure what it is Yes, we are here And move t0 to vbr Which is here Yeah, I'm going to assume you want that So the next thing is cacr We're here now we are Here this is testing to see if it's 68030 Yeah, what this is doing is it's loading this address into one of the The exception vectors So then if it executes a A presumably an instruction that's not supported It will jump to that the processor will throw that exception. It will jump to that value in exception Vector and we end up here. Okay, so eventually This here is all that code So eventually we end up at this massive But this massive compare instruction Is trying to detect whether it's been reset in various ways I'm going to assume this works and eventually we jump off to the reset vector Which is The reset vector is that actually lives at zero So it's clearly Trying to Okay, what this is doing is it's looking to see if we have a reset vector already set up And if we have done a warm boot if we've done a warm boot Then we know that Atari toss is still in memory So we just jump to the reset vector and restart it That's what this stuff is doing. It's it's keeping a magic number in res valid here If it's not There which it won't be in the first execution Then we jump to no reset which is here and that goes to Mem in it Which is somewhere else Okay, that's all looks quite plausible to be honest now mem in it is yeah some of the bios memory s He did tell it that we wanted To live in ram so that doesn't get executed Okay, this is probing available memory I think i'm going to assume that all works to be honest And I think that what I actually want to do now is to is to set up the debug output And run it for real So we're going to be using serial terminal for all input and output Which I need to find first I did find it before I know it's here somewhere So this is the Amiga code Of which there is not a lot Mainly working with the custom hardware And we know that none of this is being used because It's only compiled if machine Amiga is set So if anything was trying to call to it, we get link failures. We're actually going to want to Create a bios daner dot c Con out maybe I think this is trying to write to the screen Yes, it is So that's not what we want I think Ah conf serial console that's a thing we probably want That will go in here Right be con out K print is clearly the routine that actually Uh write stuff to the console And we want bios bios dot c I should have thought of that So what's this doing? Okay, I actually think that on the On my hardware The beginning of the address space is a bit weird But I don't think that's particularly relevant just now You're warning I do have t Okay, so this is where the bios actually starts up. So we need to make sure that k debug is enabled Let's do that be con out is the Print character to Output device. Oh, so this actually goes through the device driver layer Interesting So I still haven't found the code that's actually Writing Stuff to the serial terminal, but I'm going to guess that's going to be in Chard air init info Serial port this looks Kind of hard wary Yeah Here's where it initializes the amiga serial port So we just copy this to this And now when we build it we should end up with a link error Correct, right now we need to add our Dana dot c So this should be machine Dana Custom registers are going to be I've been working with these a lot actually The urx one is at Volatile u-word ff ff ff 904 And tx is at 906 and we don't need any of them We don't Actually, if you don't need anything it comes up to the RS 232 stuff Okay So no initialization needs doing because it's already initialized We can write when This bit is set And where did I put my data sheet? uart u tx one Is here So we can write when bit 13 tx available is set at 906 Tx is at 906 therefore all we need is this Right in order to write we spin wait until the Serial port is ready And then we write our byte to here We don't want to write to anything else. So we're actually going to do Hope that's a valid name Tx1d equals b And this is irrelevant So that should Be all we need so Okay So there's no conditional assembly. So we do need the if death and if All right So when we build it Yeah, we need a We need a header file too. So we just simply chop out All of the Amiga stuff except the stuff we care about Globally search and replace Amiga to Dana and in lowercase, and we should be done Oh, of course apart from changing that and that declaration of Dana rs 2 3 2 in it And it builds 100k Fabulous, okay So let here let's go to our tool We run the initialization script. All right, and the board was already reset What that's done is it's programmed all the registers needed to set up the ram So that we now have Ram present and I can dump the contents like this And you can see it contains garbage because it's not initialized You can then You just double check the Load address These are variables Here we go os header is 2 140 So we should be able to write utas image o x 2 140 and we upload The link is not checked summed in any way. So Hopefully it will be getting there approximately right I In the future, I'm just going to skip past this Like not even with the black screen or anything because it's really boring But this time you're going to have to sit through it Just so you can see how long it's going to take There are options. I could compress the image and then have it automatically decompress when it hits memory There's pretty decent code for doing that Not in emu task elsewhere Okay, it's there So I should be able to do 2 140 512 And here is our image in memory So now I should be able to do execute o x 2 140 Then immediately Fire up the serial terminal And we're going to see what happens Nothing whatsoever Yay It's exactly what I wanted to see. No, not really I was hoping to see at least something show up It's possible that I need Some more initialization to make KD bug work, so That's to see does the String bios in it appear in here anywhere. Yes, it does So I think it is trying to do something. It's just not Maybe it's not got as far as bios in it I would love to have an actual debugger, but I don't so What we are going to do Is here in startup.c In real main We're going to scatter these instructions through it which should hopefully Hopefully write some tracing So we're going to actually have to Test dot b Oh, we can't do that here because we haven't set up the Stack yet So this is This isn't going to wait for the previous byte to be written out to the serial port Which is a shame So we're probably going to get garbage if it works at all But here is the point where we can we should not have called comf with reset disabling the mmu check to jump To various vectors And then we head into mem in it So mem in it is here. We need We actually need the same wait to dx code This appears to be all the code for detecting how much memory is available. I don't actually know what it does for probing this What we'll find out I hope it's possible that we have some stray hardware enabled no like this stuff for Uh, detecting ram and it's corrupting itself Wow, there's a lot of this I'm pretty sure I'm adding these tracing between subroutines, but that's fine Seems to be resetting the stack here Okay, so We reset the board We write it And we run it Yay, nothing at all Well, like it's still just because I reset the board doesn't mean the ram's gone away. So this Very approximately looks like the right the actual right thing So why is that therefore not doing anything at all? One option is that all the tracing is actually appearing before we've had a chance to fire up the serial terminal And then it crashes So let's go into start up. We'll see and here we're just going to go like this So it should just keep spewing Let's just do this actually So this should just keep spewing zeros since here real port Okay, so now we run it Okay, we've got to here So we're just going to have to do this the brute force way. I'm afraid So you've got a piece of code there that Causes serial tracing to spew out Where do we call mem in it? Are we getting as far as there? That's Here So So I was hoping we could get this all done in one go But it looks like we're just going to have to keep moving that piece of code And then eventually we'll find out the furthest point it gets to But there's a whole lot of I need to reset There's a whole going to be a whole lot of repeated tries and binary splitting Okay to run Good That means we've got to here we've got as far as calling into mem in it. Let's go to memory s Uh get rid of all our old tracing So this is going to be Searching for the ram Where's the Where does it actually get to at the end? Oh, wait a minute. Wait a minute. It goes to It goes to mem done This is where we finish we go back to the startup code. So if we put this in here, let's just change this Then Yes while I was at it. I also Changed the execute command so that it fires up a terminal once it's finished So reset Let me see what happens Okay, so what happens when we run this? fantastic Right we've gone through the memory startup sequence Which is nice. That means we've arrived at mem done. Oh, which is here Right. I mean now we go straight to bios main Right, we should be here And then we go straight into bios in it and we should start getting tracing. So let's just Uh, let's go find out what k debug does shall I so this Calls k info Which calls k printf Native debugging output. Okay. What's this? Oh, right. That's the routine that decides whether to Uh Send the size web send the K print output stonks is one of the emulators this will cause the debugging output to appear On the emulator console. So this is the thing I need to enable In fact In fact, I think I will Yeah, you see this is ultra low-level routines for sending stuff to the terminal So I am going to copy that Because I don't trust the the device driver framework just yet Place cold fire with Dana Dana rs2c2 write byte Can we like can I do write b in a debug print? Okay, we now need to go to config here and print Okay so We set go write and wait And now we run it and see what happens crossing fingers Well, we got a one Why did we get a one? We got that one But nothing happened So See this code looks all right. I don't see any problems there Which suggests that something else is wrong So if I do Dana rs2c2 write bq Like so Then hopefully we'll know a bit more So what does this do? intriguing So k debug. Yeah, k debug is actually enabled here So it hasn't printed anything Let's take a look At what the code actually does shall we? If I can find the object files obj bios Okay, so if you look for rs2c2 write b interesting why Is that not let's just try rebuilding that to see Okay, it's recreated the object file Bios main is the real function. So this should exist Here it is So bios main called bios init And bios init has been inlined by the compiler So we should be here Unless there is more than one definition of bios init and this hash defines There seems to be only one because this Code doesn't really match What I'm seeing in the disassembly. Let's try Uh, is it be compiled it all without yeah, it's compiled the whole thing with no debugging information So let's see if we can turn that on because that will help a lot There's not really any excuse for building without debug symbols being generated Because it it doesn't get added to the resulting binary and it doesn't change the code generation and it gives you vastly better Disassemblies, okay, so here is bios main Ah, right It has actually called kdbug But the symbols don't appear directly in the disassembly because these values all get relocated later Uh, there is a Option to enable them Yeah, here it is So now if after every relocation it actually displays it. I forgot to put that in earlier Okay, so we can see it call rs232 write byte. That's producing the queue that we can see there Then it calls kprintf Then it calls write byte again. So kprintf is not I know what I did wrong So I added this function But I didn't add the corresponding call to actually Use it. Okay. That was my fingers not doing what they were told. Okay right, so We reset the computer Every time I do that by the way I'm reaching over and hitting the reset button that I soldered onto my breakout board and that was wow such a good idea Actually like manually tapping the reset pin with a wire is just would not be tenable okay, uh, so now we run it and Whoa We got somewhere Not far, but it is somewhere Right, we got into processor in it and then it crashed So where is processor in it? In general with porting these operating systems The low level stuff takes about 90 percent of the time And then the high level stuff also takes about 90 percent of the time Right. Oh dear machine code Seeing as this is largely a waste of time as we know this thing is going to be a 68 000 One quirk I've discovered of this thing If I just reset the board is If I fill At the bottom of uh, that's I have to do this in small bits Ah, I didn't read I have to initialize the ram first Okay, so If I dump The bottom of memory So I've cleared this And you can see that there are these ffs sitting In memory and I can't overwrite them And I have no idea what's going on there There's the rest of the memory seems to be fine, but those bits are not so great Um, I don't think this is a 28 Uh, this is the initials stack pointer This is the initial program counter So provided we're not doing a warm boot when it tries to like use these we should be fine And as long as none of this code here tries to Call a vector here, we should be fine. I wonder if I should just hard code this for now Do we have this set? This is a useful trick. Yes, we do have conf with advanced cpu set Well, we know we don't have one So this ought to simplify things a bit Yikes conf with apollo 68080 well Hmm, I don't know why those were set in the first place to be honest. Is apollo 680 If conf with apollo, oh, right. I think I need to clean This yeah, that's better And our image hasn't really got any smaller okay, uh, so You've heard me rant about how I dislike make. This is one of the problems. Um, I changed one of these Uh configuration definitions and it then didn't go and rebuild all the things that needed to be rebuilt So we ended up with an inconsistent build Okay, and let's run this Do what happens Excellent. We got a long way through startup We did get a panic, which is a bit annoying I mean, it's annoying that we didn't get any more information about what the panic was Uh, so vt 52 in it is probably here However, that is actually being said by Biostacy that's here Okay, so we got into vt 52 in it, but we didn't come out again Now this message about the address bus that is wrong Right, but advanced cpu is supposed to Like if we don't have an advanced cpu then assumes we have a 24 bit address bus I think that is fine We are going to want I'm going to want eventually to configure the processor to use a 24 bit address bus Because I don't need any of the 32 bit features and there's a little bit of Atari software that that needs a 24 bit bus I'm just hoping that it's not going to do anything That requires a 24 bit bus So we need to find out why This is dying Possibly because we haven't initialized any kind of screen See, yeah This is why I was hoping to not start up the graphics system Right, I bet I know what's happening Which is that the frame buffer is being set thinking it's an Atari system And it's all going horribly wrong So let's Do this let's just try This is only missed to see what actually gets produced So Right this entire This entire function is this code here. It all just goes away Which is good So we probably want to put in here somewhere Dana screen in it I don't actually want to make the screen work at this point. I want to use the serial console I just need to keep it happy enough not to crash later Okay, so let's take a look at what a meter screen in it is doing So what we have got here in the Amiga code is we set a video mode This is all Amiga stuff And in fact nothing happens This is all setting Um This is all hardware setup. So That just becomes nothing over here in screen See the next thing that looks suspicious is screen in its address Which initializes the Uh The frame buffer itself So we can either have a hard coded address Or it Figures out The size of the frame buffer and allocate it dynamically And that is what the code here is doing So initial VRAM size You know What's that actually originally Yeah, okay, that was originally if def That's a bit dubious. You should use consistent users Otherwise you get confused the way I did. Okay. We need Screen in it and initial VRAM size You've got Dana screen in it. I have saved that Oh That's initial implicit declaration Should be using the compilation flag to forbid implicit declarations Okay So we not want to know the size of the frame buffer well Dana initial VRAM size The screen is 540 by 160 and it's monochrome single bit So it is that many bytes Okay Before we run it again, let's go back down to the screen and let's see where the amiga is Doing things This allows you to change video mode, which we don't have initialize the screen if def machine Dana false Get current mode info Get current mode info So Actually, let's just do one plane 540 160 Just the same as the L. There's the Lisa down here palette size monochrome only pixel size Okay, so pixel size is To deciding whether the pixels are square or tall and skinny These old machines tended to use tall and skinny pixels because The standard resolution is like 640 pixels across by 320 high Which gives you 80 by 25 8 by 8 characters However, our screen uses square pixels So I have no idea what these numbers are. So let's just call the Get standard pixel size function. I think here we need to do this Can you really Change the address? I mean does a Atari Toss let you change the address physical screen. Well, we can actually do that. So Set screen, I think that's right Yeah, I'm not quite actually sure what that will do Set color we are going to ignore I mean it's monochrome I don't think we need to do anything here because res changeable should be false Yep And I think we are Done Okay, we need to implement a bunch of stuff Fizz base and set fizz well these don't too much So what is Amiga screen base for? It's a pointer right this because the Amiga is using the The copper coprocessor To read from the frame buffer. So this got actually got the address of the physical frame buffers pointer Hard coded in the copper code So all you need to do is update this and the frame buffer will change We will have to be a little bit more clever, but for the time being Let's just Do it like that Okay Reset the board do a right and let's see what happens now Okay, so let's see what happens Well, I know this is wrong for a start That is not a good address So where is it getting that address from? ebas add Okay, we are someone who's just called set screen with the logical and physical screen addresses Probably screen init address Ah, no, we are actually here Uh, so we have Tried to allocate some Okay I think what this has done is it hasn't allocated memory from ram I believe that this has allocated address space Expecting the video memory to show up there when it gets mapped But let's go look for bia lock st ram That is in Mem No, actually I was wrong there So fizz top is supposed to be the top of actual ram The screen's allocated from the top of that therefore for this value to have been produced Then it's all gone horribly wrong So let's turn this on. I think the memory Detector has mis-detected Ram So let's see what comes out Okay, and run it Right, what do we see? uh Well This is wrong These are all values that it's got from the rom itself. So they will actually seem to be They look plausible So, yeah, it's clearly detecting memory incorrectly so Mem top equals fizz top Where does that come from? maybe My responsibility To set that because I've told it is running out of ram Therefore, it's may may expect the the front end the thing that actually loads the The image which is normally, you know, like a Um a program loader Maybe it expects that to set the various values Because this garbage value does look kind of like what was originally in ram So I can actually figure this out By dumping This okay, so we see that we go from mem in it We initialize the flag and then we go directly to mem check Which is here We skip all of this except this Then we go to here where we Look for magic numbers Then we go to st ram detected, which is I think way down here. Here we go Yeah Right, we it has in fact, we do actually have to tell it what the Top of memory is we should be able to do that in here Uh, or rather in Here somewhere which should be Actually, I'm not sure that is the right place So this is the startup code Is there are are there any romega references? Yes, there are What is this? Right, this is how that we tell Uh Emutos what kind of machine we are so we're going to have to yeah, let's just do that Now With is there a comf with Dana? No, there is not Okay, so we're going to need to copy one of these Dana this becomes zero Okay Okay, uh, yeah, let's go go back to here um machine in it sounds Plausible, but I think I will put it here So in Dana dot h We Do And then in here we We've got 16 megabytes of memory. So that is 16 by 1024 1024 However, I'm a little concerned about The warnings I was getting a moment ago Ah, this is of course an address And the integer overflow was coming from here Really is this Surely this is not defined using 16 bit integers. I think it was, you know, okay So reset and right So we run it and Much better. Okay Uh Memtop is now here at 16 megs We've allocated some memory there We still get a panic Do we have 16 megs? I did look the chip up. Maybe I misread the number That to eight meg and see if that makes a difference But at least now giving us a useful address error with Uh You know the address that caused the problem And where we were when the problem happened So let's try with eight megs and see if that makes a difference Okay, so Execute Um, oh, I know That is a odd address And I bet it's just tried to I bet it's just tried to Write a word to it So 4520 is 45 blank out, right? He's actually trying to write to the screen at this point Interesting. So this is all now generic code. Why is it complaining about Potentially unaligned Accessors But we shall actually We set the board and try and dump that address Okay, that's working. That's doing Wait a minute. That's not the right address Okay Dump here uses byte accessors. So it should be fine So one three was there Okay, where is blank out? con out Who's reading with the background color? 4520 which is the Where the exception happened is fairly near the end. So I'm gonna guess that it was probably this. So where is it getting that address from? There perhaps It's the sick does the six eight thousand require alignment. I do not know. I will go look that up Yes, it does So This address here should be aligned. Otherwise This cannot work So cell adder convert cell x y to a screen address 540 is not a Round number Currently assumes the font width is eight bits. So Okay, so what is 67 by 8? 536 so let's try that Let's see if that does anything it's that is still an odd number of characters See the Lisa here is Is 720 Which is 90 characters Hmm Okay, so now let's try it Same problem So our base address is aligned Our video RAM is well, there's a number I'll put that back to 540 Uh Hang on a second. Hang on a second. I'm just wondering what the chip select registers are initialized to Uh Four mega flash and eight mega RAM. Okay That should be right You see this this sets the mapping of address space to the various memory blocks on the system So this is telling it that the RAM starts at zero and is eight meg long Uh, I was wondering whether this was set to a small nerve value I Will actually do that Because I am not at all sure that I'm interpreting all these bits correctly in the chip select registers So that is Okay, it is doing Precisely the same thing at the same offset. So Yeah, okay, let's figure out exactly what instruction that's happening that's happening at Um, unfortunately because we do not have an image with a Elf file, I cannot just disassemble it hang on a second Interesting so How does it know it needs to write out a binary file? Uh, it could be the Yeah, here we go So I need to do No format I think this will list the no it won't it doesn't produce Elf files, but I might be able to make one of these Hopefully that will contain the Debug information. Okay, it's not a Elf file, but So now I should be able to just do New task There we go So we are at four five two zero Wait a minute two zero two zero. That's Not where I was So six e um I am confused So these addresses don't look right to be honest And let me just double check that so blank out here. So this says it starts at forty four four three zero. So Four four three zero So four five two zero is Somewhere around here But there is nothing problematic about any of that code This source code looks like garbage There's just this routine blank out. It's got nothing to do with any of These lines of source which is irritating But at least we've got a disassembly as to what's going on So This is the address. It's complaining about accessing And there are no instructions around here that would be doing that So this is a Integer add instruction To address registers This decrements d five and conditionally branches to four five one h is there I have no idea what the st instruction is Let me look that up Set according to condition So st set on true set always it sets the The destination to ff. It's a weird optimization So what this is doing is it's setting The thing at this address to ff, which is a two which is zero one Two But here you can see the address we're worried about is in a zero Something is not right here I have a feeling that that line is not doing what I thought it was. So let's get rid of that and let's There we go And let's just take a look at the raw object file Of course, we don't have any addresses handy, but This does indeed look different Okay, right, let's do this the way you should have done before Right blank out is at four four thirty And pc is four five two oh so four five two zero minus So four four thirty Is it offset f zero? This is at one eight c So we should see our instruction at two seven c So eight nine a b c Why that would be producing a Exception I don't know but this is indeed a unlined right And in fact So if Yeah, I I don't know how this could ever work. This is a unlined address And then this is trying to use unlined accesses to write to it And 68 000 can't do that so either there's Something deeper going on or This code doesn't do what I thought it Ah Must be even must be odd Right, that's why it works So cell agile is returning a unlined address because something is Not aligned I just need to make sure that we can do these integers Yes, we can oh we can do p for pointers, which is good Yeah, I think that our screen is a Invalid size so let's put that back up to eight until we know it works. This can be Um It's 480 V car off is that And let's try this Okay run That's a lot of you but Okay, that did indeed hit an address error But it's all Mangled with the rest of the tracing I also forgot to put a New line Yeah, so what have we got? Uh base address displacement is x and y x y zero You see I Don't see Any reason why these would be unlined I mean it's not even as if the screen is set up Skip non-region area with stride advanced that also Needs to be Aligned where does v lin were come from? Interesting. What's this? v lin were bytes per scan line Is 80? I mean it's wrong, but Wait a minute. No, this is hardware specific so Something should be initializing this where is the for example The amiga Initializing it is it in the vdi code. I think it could be Here it is Hang on I can do better than this pti control v lin were equals update res dependent So this is the Horizontal resolution Times number of planes number planes is one and this is Uh this where is that value set is that uh It is a variable It's set by this screen get current mode info and the results are put into these variables so Get current mode info interesting That's and that is in fact a different function than the one I was looking for this one Ah Okay, so this needs to be a aligned value otherwise everything goes horribly wrong This is going I'm going to have to a lot of work on this to get the screen actually working But for the time being let's just try and get the system up and running We're actually most of the way there. I'm really surprised I mean, we've got the exceptions all being handled. We've probably got interrupted by now I didn't do anything We probably don't have a timer No, there won't be a timer because the 68 000 won't actually have one Won't have a standard One it's part of the actual implementation. So I need to figure out where that happens Anyway, let's just try running this Right, we have got further on Ah, there's the timer. I wonder what that does Right, I need to provide it. I have no idea what mfp is But it actually it looks like a standard timer module So possibly we've got one That would be nice Because I don't see anything there about the Amiga so xp timer is here mfp base multi Frequence See something which is set up Here Okay, so let's go over look at our data sheet general purpose timers Is it 600? So do we have anything at ao? So the lcd hardware is at ao and there's nothing at a 80 So we are not using the mfp timer module That is a shame Right, we're going to need to do our own custom timer module So Our timer was in It was in fact in mfp.c Is the mfp enabled by default? I somehow guess it is No, it's not Yeah, a lot of these things should have an else No timer not defined So Okay, so what do we have to do to initialize the timer? Well Let's look at the lisa code That looks pretty simple These are two via clock Yeah, hardware is Not my favorite stuff. Okay. What have we gotten this thing two? identical timers With interrupts restart and free running that's simple enough A restart timer is when the timer reaches a particular value it resets to zero Free running mode is the timer continues running indefinitely and just wraps around when it reaches the maximum Restart mode timers allow you to generate periodic interrupts at any arbitrary interval, which is just what we want so So i'm going to have to go and actually figure this out and also go and look at the Palmos ROM disassembly, which i've got and figure out what it's doing But i'm actually more interested at the moment I think it's more fruitful to figure out why We're crashing after init c port and if you should hit sound init What is conf with scc and do we have it? We do not have it. Okay, so init c report is crashing somewhere Well, we should have initialized the The daner serial port hardware. So What else could be going wrong? Okay, let's disassemble it in time on a tradition and figure out What code is actually in here? Okay, so This initializes Some structure that defines the serial port Then we skip all of this nonsense and just call the daner initialization code Then we do this stuff. Right. I know what's going on here Which is that we have not set up all the callbacks Defining the device Nope, i'm wrong. There is nothing here. So in this case, how does it know What routines to call? This mem copy right that mem copy contains Contains all the initial values for the rs 2 3 2 buffer, etc. All the stuff that makes the device work Then over here we seem to have tables of callbacks That actually make it do things So do we have this? No, do we have that? No Yeah, I still think that nothing is setting up those callbacks. I don't know whose job it is to do this uh iorek appears to be the data But the callbacks are Let's actually go and look see what what that structure looks like No callbacks so When this is actually calling something I bet this is the thing that's failing RS conf pointer rs conf one s conf one is this Okay, this is not doing anything for us, but that's fine. We don't want it to do anything At least for now But that is like a valid thing brute force time underscore underscore line Returns the current line number So we can simply scatter these throughout the code And we should get some stuff coming out So reset and upload and let's see what happens Okay, so when we run it, what do we get? I forgot to put the new lines in uh, okay, so The last time We got to here therefore In its report returned, um So have we died here? So I think the serial port stuff or what worked and it's the Unless it's managed to corrupt its stack which does happen So here is the code that In its serial port Well, that's the that's the kd bug just before that Then we in it the serial port Then we update the boot status and that's a perfectly valid pointer And then we get on to sound in it. So There should be nothing there that causes problems. You do wonder whether it might be Trashing its own stack, which means that the When this function returns It will jump into nowhere, but then I would expect to see some kind of panic appear So what's this doing? Okay In its report, we're in bios.c line 411 So we've printed that But we haven't printed anything else So here is our 411 and then we should be printing 682 So is it This no, there's nothing wrong with that. That's uh, that is an aligned and an aligned address Let's just be absolutely sure Okay, and run it Yeah, it somehow something Doesn't like this. Um Let's just try this it may be a timing issue some description So it just so happens that it's dying a little bit after This Or you know corrupting memory or anything like that I wouldn't expect it to look like that. It was corrupting memory though. I would extend. I would again expect to panic all right, and what this does is Goes quite a long way further on It doesn't like updating boot status really Why it calibrate delay block devs os in its Finish with bios in it. We've got all the way through bios in it But there is nothing at all Controversial about that line of code It's as simple as you can get this That's deeply deeply weird ac6 is The address of boot status Which like you can see it's been correctly set just up here So why is it allowed there and not further on? odd very odd, okay, but we've reached the end of bios in it So I think we go back to start up Oh, no, we don't no, we don't we're still in bios We should have hit Processor in it. I thought that would happen early sound init keyboard minute init acia vex We don't have an acia and we don't have any midi in it acia Uh, okay, I don't think this is hardware. I think this is No, this is hardware Do we have that? No, we don't that's good. Okay. These are internal vectors. They've got nothing to do with the hardware. So that's fine midi Don't think we've got any midi We don't have any midi. So that's fine, too Okay, so we go to calibrate delay Requires interrupts to be enabled. Well, we don't have the timer Block dev init After block dev init Power port after clock init OS init for x mad alt whatever that is After x mad alt we are here Bios init end So I would then expect the next thing that's happened is Dana init But there's nothing here No I'm looking at the wrong place. Yeah, he's getting moderately late. I'm gonna have to finish soon I want to be here where bios init is called Right, so These messages down here are not mine. They're from the kernel These ones are mine, but we know we've got past boot flags here. I Think to be honest that it's actually trying to Run the graphical environment on an invisible screen That's what this is Possibly doing We should have the Yes, we've got the cli and this is supposed to start up console and run the interpreter I want to persuade it to Do this so it enters the cli before doing anything else So in fact, we probably want to do this with this Let's see what happens All right execute Okay, we did enter the cli We got this line of tracing I actually like to know what goes on further down here. So let's just put this in standard is Who knows what that is a Right the load flags Okay So I think that this is actually trying to run something Why nothing's happening. I don't know Let's let's just get rid of this tracing because you don't need it anymore And I wonder whether there is something I need to do to make the console appear here Has it just printed stuff to the invisible screen? It's a com serial console appears to be the thing But why how do I actually get it to show up? I keyboard seems to be the keyboard Is it also the output console? Does not look like it to be honest Okay BT 52 So if we have com serial console and no Com serial console and see that seems to be the simplest configuration Do we have it? We do not so let's go to our Config and that one needs to be unset so It hasn't got much smaller to be honest But now we should be able to go here and do that Okay, there is an error. So that should be going to be con out Where is where does the con outs live not these? I would expect it to be in char dev honestly Or in bios bios perhaps So I think it's going through here Let's and see what happens Okay, and what this does is Yep, it has indeed printed lots of stuff to the console. It just hasn't shown up So what are we seeing? II II Are we sending it to two handles? Where? Come to emu con 22 version Yeah, okay Right, so it's working I think That what's wrong here Is that nothing is hooking up the serial device to these routines Something needs to be doing that otherwise it's just nothing's going to happen So let's take a look at that amiga thing again So where does this happen? Wait a minute Is the i keyboard actually the Screen okay, let's put that in but let's take a look at this first. Okay Okay Simulate right B. I have no idea what that is But let's find out where that's called from i keyboard is in i keyboard i keyboard right B Send a byte to the i keyboard Um, I am actually increasingly unconvinced by this I don't even know if the amiga Serial ports hooked up. What about that? Is that used anywhere? Here it's used here hmm See I would expect that Something would be Trying to read from The serial port as this Yeah, this is setting up an interrupt So that when anything happens on the serial port, this is called which sticks stuff into the Keyboard buffer. So I think comp serial i keyboard is the thing so So let's get this and stick it in here And I think we need to enable Serial i keyboard and let's try that and see what happens All right, and what does this do? not But um no not much And of course, I forgot to turn and tracing on here so that we can actually see whether anything there is happening Uh, it's also possible that It's just the serial port is not supported on the amiga. So Where would I find? real Atari hardware called fire, maybe I mean no, that is not real Atari hardware, but There may be more of an rs 2 3 2 Implementation So here's the interrupt handler for the serial port. So where is this used? It is used in the serial port here Yes handle one Conout one. Okay. Ah, this looks like it L if defined And Sheen Dana Dana rs 2 3 2 B and I also need to update this And if defined Machine Dana Dana rs 2 3 2 can write Okay, now I think that ought to work so I will actually Live dangerously and turn that off And I think I wanted to go to con out I don't remember where this tracing is coming from There it is Okay, now let us try this and see what happens all right execute brilliant Welcome to inucon version 20210819 type help building commands invalid drive Uh, yep, so The invalid drive is because I haven't actually told it about any drives yet We can't type of course because I haven't set up any Input And I think that does have to go through i keyboard. I I'm going to go look up how this is actually supposed to work But I am going to call that a day because that's a good lot of stuff And I'm going to chop out all my extraneous tracing And submit that we have the os actually running. It's not doing much, but it does actually has actually started up apart from that really weird thing about the Uh that boot status or thing Don't know what was going on there but Yeah, so I will come back next time. Hopefully with a little bit more working and Uh, hopefully after having read up on how timers and things work because At this point, I'm going to have to start hooking it up to some hardware I hope you enjoyed this video and please let me know what you think in the comments